refactor: restructure project layout — main.go to root, llm+config to pkg/

- Move cmd/agentu/main.go → main.go (project root)
- Move internal/llm/ → pkg/llm/ (leaf package, no internal deps)
- Move internal/config/ → pkg/config/ (leaf package, no internal deps)
- Update all import paths: agentu/internal/llm → agentu/pkg/llm (14 files)
- Update all import paths: agentu/internal/config → agentu/pkg/config (3 files)
- Update README: build/run commands, CLI flags section
- agent/session/tools/tui stay in internal/ (app-specific business logic)

Build: go build . | Test: go test ./... | Vet: go vet ./...
This commit is contained in:
loveuer
2026-06-24 07:06:26 -07:00
parent 950c63adaa
commit f235b8ce90
22 changed files with 21 additions and 21 deletions
+4 -4
View File
@@ -20,13 +20,13 @@ model/provider switching, and local tools.
mkdir -p ~/.agentu
cp agentu.example.yaml ~/.agentu/config.yaml
export AGENTU_API_KEY='your-api-key'
go run ./cmd/agentu
go run .
```
Use `--yolo` only when you want agentu to write files or run shell commands:
```sh
go run ./cmd/agentu --yolo
go run . --yolo
```
## Config
@@ -82,7 +82,7 @@ top-level OpenAI-compatible request field named `thinking`.
## CLI Flags
```sh
go run ./cmd/agentu [flags]
go run . [flags]
```
- `--config <path>` loads a YAML config file. Default: `~/.agentu/config.yaml`.
@@ -150,7 +150,7 @@ Run the verification suite:
```sh
go test ./...
go vet ./...
go build ./cmd/agentu
go build .
```
Local config and build outputs are intentionally ignored by git.
+1 -1
View File
@@ -9,7 +9,7 @@ import (
"strings"
"time"
"agentu/internal/llm"
"agentu/pkg/llm"
"agentu/internal/tools"
)
+1 -1
View File
@@ -7,7 +7,7 @@ import (
"strings"
"testing"
"agentu/internal/llm"
"agentu/pkg/llm"
"agentu/internal/tools"
)
+2 -2
View File
@@ -8,8 +8,8 @@ import (
"time"
"agentu/internal/agent"
"agentu/internal/config"
"agentu/internal/llm"
"agentu/pkg/config"
"agentu/pkg/llm"
)
type Manager struct {
+2 -2
View File
@@ -7,8 +7,8 @@ import (
"testing"
"agentu/internal/agent"
"agentu/internal/config"
"agentu/internal/llm"
"agentu/pkg/config"
"agentu/pkg/llm"
)
type recordingProvider struct {
+1 -1
View File
@@ -11,7 +11,7 @@ import (
"strings"
"time"
"agentu/internal/llm"
"agentu/pkg/llm"
)
// Session represents a persisted conversation.
+1 -1
View File
@@ -5,7 +5,7 @@ import (
"path/filepath"
"testing"
"agentu/internal/llm"
"agentu/pkg/llm"
)
func tempStore(t *testing.T) *Store {
+1 -1
View File
@@ -16,7 +16,7 @@ import (
"sort"
"strings"
"agentu/internal/llm"
"agentu/pkg/llm"
)
const defaultCodeSymbolFileLimit = 50
+1 -1
View File
@@ -13,7 +13,7 @@ import (
"sort"
"strings"
"agentu/internal/llm"
"agentu/pkg/llm"
)
type FileReadTool struct {
+1 -1
View File
@@ -9,7 +9,7 @@ import (
"os/exec"
"strings"
"agentu/internal/llm"
"agentu/pkg/llm"
)
type ShellRunTool struct {
+1 -1
View File
@@ -7,7 +7,7 @@ import (
"sort"
"strings"
"agentu/internal/llm"
"agentu/pkg/llm"
)
const MaxToolOutputBytes = 64 * 1024
+1 -1
View File
@@ -10,7 +10,7 @@ import (
"net/url"
"strings"
"agentu/internal/llm"
"agentu/pkg/llm"
"golang.org/x/net/html"
)
+1 -1
View File
@@ -9,7 +9,7 @@ import (
"strings"
"agentu/internal/agent"
"agentu/internal/llm"
"agentu/pkg/llm"
"github.com/charmbracelet/bubbles/spinner"
"github.com/charmbracelet/bubbles/textarea"
+1 -1
View File
@@ -9,7 +9,7 @@ import (
"testing"
"agentu/internal/agent"
"agentu/internal/llm"
"agentu/pkg/llm"
tea "github.com/charmbracelet/bubbletea"
"github.com/charmbracelet/lipgloss"
+2 -2
View File
@@ -13,8 +13,8 @@ import (
"strings"
"agentu/internal/agent"
"agentu/internal/config"
"agentu/internal/llm"
"agentu/pkg/config"
"agentu/pkg/llm"
"agentu/internal/session"
"agentu/internal/tools"
"agentu/internal/tui"