Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ builds:
goarch: arm64
ldflags:
- -s -w
- -X github.com/tim/cu/internal/version.Version={{.Version}}
- -X github.com/tim/cu/internal/version.Commit={{.Commit}}
- -X github.com/tim/cu/internal/version.Date={{.Date}}
- -X github.com/tim/cu/internal/version.BuiltBy=goreleaser
- -X github.com/timimsms/cu/internal/version.Version={{.Version}}
- -X github.com/timimsms/cu/internal/version.Commit={{.Commit}}
- -X github.com/timimsms/cu/internal/version.Date={{.Date}}
- -X github.com/timimsms/cu/internal/version.BuiltBy=goreleaser

archives:
- id: cu-archive
Expand Down Expand Up @@ -83,6 +83,12 @@ homebrew_casks:
directory: Casks
homepage: "https://github.com/timimsms/cu"
description: "A CLI for ClickUp — like gh is for GitHub"
hooks:
post:
install: |
if OS.mac?
system_command "/usr/bin/xattr", args: ["-dr", "com.apple.quarantine", "#{staged_path}/cu"]
end

release:
github:
Expand All @@ -96,14 +102,14 @@ release:
footer: |
## Installation

### Homebrew (macOS/Linux)
### Homebrew (macOS)
```bash
brew install timimsms/cu/cu
```

### Go
```bash
go install github.com/tim/cu/cmd/cu@v{{.Version}}
go install github.com/timimsms/cu/cmd/cu@v{{.Version}}
```

### Direct Download
Expand Down
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ MAIN_PATH=./cmd/cu
VERSION=$(shell git describe --tags --always --dirty)
COMMIT=$(shell git rev-parse --short HEAD)
DATE=$(shell date -u '+%Y-%m-%d_%H:%M:%S')
LDFLAGS=-ldflags "-X github.com/tim/cu/internal/version.Version=$(VERSION) \
-X github.com/tim/cu/internal/version.Commit=$(COMMIT) \
-X github.com/tim/cu/internal/version.Date=$(DATE) \
-X github.com/tim/cu/internal/version.BuiltBy=make"
LDFLAGS=-ldflags "-X github.com/timimsms/cu/internal/version.Version=$(VERSION) \
-X github.com/timimsms/cu/internal/version.Commit=$(COMMIT) \
-X github.com/timimsms/cu/internal/version.Date=$(DATE) \
-X github.com/timimsms/cu/internal/version.BuiltBy=make"

# Default target
all: build
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ npm install -g @clickup/cli
```

### Direct Download
Download the latest release from the [releases page](https://github.com/tim/cu/releases).
Download the latest release from the [releases page](https://github.com/timimsms/cu/releases).

## Quick Start

Expand Down
2 changes: 1 addition & 1 deletion cmd/cu/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package main
import (
"os"

"github.com/tim/cu/internal/cmd"
"github.com/timimsms/cu/internal/cmd"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion docs/project-buildout/PHASE_1_FOUNDATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Establish the core project structure, development environment, and foundational
## Task Checklist

### 1. Project Initialization
- [x] Initialize Go module: `go mod init github.com/tim/cu`
- [x] Initialize Go module: `go mod init github.com/timimsms/cu`
- [x] Create standard Go project structure:
```
├── cmd/
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/tim/cu
module github.com/timimsms/cu

go 1.24.4

Expand Down
4 changes: 2 additions & 2 deletions internal/api/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"time"

"github.com/raksul/go-clickup/clickup"
"github.com/tim/cu/internal/auth"
"github.com/tim/cu/internal/errors"
"github.com/timimsms/cu/internal/auth"
"github.com/timimsms/cu/internal/errors"
)

// Client wraps the ClickUp API client
Expand Down
2 changes: 1 addition & 1 deletion internal/api/retry.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"net/http"
"time"

"github.com/tim/cu/internal/errors"
"github.com/timimsms/cu/internal/errors"
)

// retryTransport implements automatic retry with exponential backoff
Expand Down
2 changes: 1 addition & 1 deletion internal/api/users.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"sync"

"github.com/raksul/go-clickup/clickup"
"github.com/tim/cu/internal/cache"
"github.com/timimsms/cu/internal/cache"
)

// UserLookup provides user ID lookup functionality
Expand Down
2 changes: 1 addition & 1 deletion internal/api/users_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/raksul/go-clickup/clickup"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/tim/cu/internal/testutil"
"github.com/timimsms/cu/internal/testutil"
)

// mockClient for testing UserLookup
Expand Down
2 changes: 1 addition & 1 deletion internal/auth/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
"strings"

"github.com/tim/cu/internal/errors"
"github.com/timimsms/cu/internal/errors"
"github.com/zalando/go-keyring"
)

Expand Down
2 changes: 1 addition & 1 deletion internal/auth/mock/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ The mock package includes:
```go
import (
"testing"
"github.com/tim/cu/internal/auth/mock"
"github.com/timimsms/cu/internal/auth/mock"
)

func TestMyCommand(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions internal/auth/mock/fixtures.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"fmt"
"time"

"github.com/tim/cu/internal/auth"
cuerrors "github.com/tim/cu/internal/errors"
"github.com/timimsms/cu/internal/auth"
cuerrors "github.com/timimsms/cu/internal/errors"
)

// Common test tokens
Expand Down
4 changes: 2 additions & 2 deletions internal/auth/mock/mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"sync"
"time"

"github.com/tim/cu/internal/auth"
cuerrors "github.com/tim/cu/internal/errors"
"github.com/timimsms/cu/internal/auth"
cuerrors "github.com/timimsms/cu/internal/errors"
)

// AuthProvider is a mock implementation of auth.Manager for testing
Expand Down
4 changes: 2 additions & 2 deletions internal/auth/mock/mock_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/tim/cu/internal/auth"
cuerrors "github.com/tim/cu/internal/errors"
"github.com/timimsms/cu/internal/auth"
cuerrors "github.com/timimsms/cu/internal/errors"
)

func TestNewAuthProvider(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion internal/cache/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"sync"
"time"

"github.com/tim/cu/internal/config"
"github.com/timimsms/cu/internal/config"
)

// Cache represents a simple file-based cache
Expand Down
18 changes: 9 additions & 9 deletions internal/cmd/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ import (
"time"

"github.com/spf13/cobra"
"github.com/tim/cu/internal/auth"
"github.com/tim/cu/internal/output"
"github.com/timimsms/cu/internal/auth"
"github.com/timimsms/cu/internal/output"
)

var (
apiMethod string
apiData string
apiMethod string
apiData string
apiHeaders []string
)

Expand Down Expand Up @@ -60,7 +60,7 @@ For example, use "/team" for https://api.clickup.com/api/v2/team`,
Args: cobra.ExactArgs(1),
Run: func(cmd *cobra.Command, args []string) {
endpoint := args[0]

// Ensure endpoint starts with /
if !strings.HasPrefix(endpoint, "/") {
endpoint = "/" + endpoint
Expand Down Expand Up @@ -100,7 +100,7 @@ For example, use "/team" for https://api.clickup.com/api/v2/team`,
// Set headers
req.Header.Set("Authorization", token.Value)
req.Header.Set("Content-Type", "application/json")

// Add custom headers
for _, header := range apiHeaders {
parts := strings.SplitN(header, ":", 2)
Expand All @@ -113,7 +113,7 @@ For example, use "/team" for https://api.clickup.com/api/v2/team`,
client := &http.Client{
Timeout: 30 * time.Second,
}

resp, err := client.Do(req)
if err != nil {
fmt.Fprintf(os.Stderr, "Request failed: %v\n", err)
Expand All @@ -135,7 +135,7 @@ For example, use "/team" for https://api.clickup.com/api/v2/team`,
// Check for non-2xx status codes
if resp.StatusCode < 200 || resp.StatusCode >= 300 {
fmt.Fprintf(os.Stderr, "API request failed with status %d: %s\n", resp.StatusCode, resp.Status)

// Try to parse error response
var errResp map[string]interface{}
if err := json.Unmarshal(respBody, &errResp); err == nil {
Expand Down Expand Up @@ -182,4 +182,4 @@ func init() {
apiCmd.Flags().StringVarP(&apiMethod, "method", "X", "GET", "HTTP method (GET, POST, PUT, PATCH, DELETE)")
apiCmd.Flags().StringVarP(&apiData, "data", "d", "", "Request body data (JSON)")
apiCmd.Flags().StringArrayVarP(&apiHeaders, "header", "H", []string{}, "Custom headers (format: 'Header: value')")
}
}
14 changes: 7 additions & 7 deletions internal/cmd/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func TestEndpointNormalization(t *testing.T) {
},
}

for _, tt := range tests {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
// This tests the logic that should add leading slash
result := tt.input
Expand All @@ -83,11 +83,11 @@ func TestEndpointNormalization(t *testing.T) {

func TestHeaderParsing(t *testing.T) {
tests := []struct {
name string
headers []string
expectedKey string
expectedValue string
shouldParse bool
name string
headers []string
expectedKey string
expectedValue string
shouldParse bool
}{
{
name: "valid header",
Expand Down Expand Up @@ -129,4 +129,4 @@ func TestHeaderParsing(t *testing.T) {
}
})
}
}
}
4 changes: 2 additions & 2 deletions internal/cmd/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"strings"

"github.com/spf13/cobra"
"github.com/tim/cu/internal/auth"
"github.com/tim/cu/internal/config"
"github.com/timimsms/cu/internal/auth"
"github.com/timimsms/cu/internal/config"
)

var authCmd = &cobra.Command{
Expand Down
4 changes: 2 additions & 2 deletions internal/cmd/bulk.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"strings"

"github.com/spf13/cobra"
"github.com/tim/cu/internal/api"
"github.com/tim/cu/internal/output"
"github.com/timimsms/cu/internal/api"
"github.com/timimsms/cu/internal/output"
)

var bulkCmd = &cobra.Command{
Expand Down
20 changes: 10 additions & 10 deletions internal/cmd/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"time"

"github.com/spf13/cobra"
"github.com/tim/cu/internal/cache"
"github.com/tim/cu/internal/output"
"github.com/timimsms/cu/internal/cache"
"github.com/timimsms/cu/internal/output"
)

var cacheCmd = &cobra.Command{
Expand Down Expand Up @@ -102,7 +102,7 @@ func showCacheInfo(cmd *cobra.Command, args []string) error {
}

allCacheInfo = append(allCacheInfo, info)

totalSize += stats.TotalSize
totalEntries += stats.TotalEntries
totalValid += stats.ValidEntries
Expand All @@ -112,10 +112,10 @@ func showCacheInfo(cmd *cobra.Command, args []string) error {
// Output based on format
if outputFormat == "json" || outputFormat == "yaml" {
result := map[string]interface{}{
"caches": allCacheInfo,
"total_size": totalSize,
"total_entries": totalEntries,
"valid_entries": totalValid,
"caches": allCacheInfo,
"total_size": totalSize,
"total_entries": totalEntries,
"valid_entries": totalValid,
"expired_entries": totalExpired,
}
return output.Format(outputFormat, result)
Expand Down Expand Up @@ -253,12 +253,12 @@ func formatCacheTime(t time.Time) string {
if t.IsZero() {
return "never"
}

duration := time.Since(t)
if duration < 0 {
return t.Format("2006-01-02 15:04:05")
}

switch {
case duration < time.Minute:
return "just now"
Expand All @@ -271,4 +271,4 @@ func formatCacheTime(t time.Time) string {
default:
return t.Format("2006-01-02")
}
}
}
Loading
Loading