@mndrk/agx 1.4.4 → 1.4.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,174 +1,184 @@
1
1
  # agx
2
2
 
3
- Unified AI Agent CLI with persistent memory. Wraps Claude, Gemini, and Ollama with automatic state management via [mem](https://github.com/ramarlina/memx).
3
+ Task orchestrator for autonomous AI agents. Uses `mem` for persistent memory across sessions.
4
4
 
5
5
  ```bash
6
6
  npm install -g @mndrk/agx
7
7
  ```
8
8
 
9
- ## Quick Start
10
-
11
- ```bash
12
- # Simple prompt
13
- agx claude -p "explain this code"
9
+ ## Core Concept: Wake-Work-Sleep Cycle
14
10
 
15
- # Use default provider
16
- agx -p "what does this function do?"
11
+ Agents have **no memory** between sessions. All continuity comes from `mem`:
17
12
 
18
- # With persistent memory (auto-detected)
19
- agx claude -p "continue working on the todo app"
20
-
21
- # Autonomous mode - creates task and works until done
22
- agx claude --autonomous -p "Build a todo app with React"
13
+ ```
14
+ WAKE Load state WORK Save state → SLEEP → repeat
23
15
  ```
24
16
 
25
- ## Memory Integration
17
+ This enables truly autonomous operation across multiple sessions.
26
18
 
27
- agx integrates with [mem](https://github.com/ramarlina/memx) for persistent state across sessions:
19
+ ## Quick Start
28
20
 
29
21
  ```bash
30
- # If ~/.mem has a task mapped to cwd, context is auto-loaded
31
- cd ~/Projects/my-app
32
- agx claude -p "continue" # Knows where it left off
22
+ # Create and run a task
23
+ agx new "Build a REST API with auth"
24
+ agx run build-rest-api
25
+
26
+ # Or one command for full autonomous mode
27
+ agx -a -p "Build a REST API with auth"
28
+ # ✓ Created task: build-rest-api
29
+ # ✓ Daemon started
30
+ # ✓ Working...
31
+ ```
32
+
33
+ ## Task Management
33
34
 
34
- # Create task with explicit criteria
35
- agx claude --task todo-app \
36
- --criteria "CRUD working" \
37
- --criteria "Tests passing" \
38
- --criteria "Deployed to Vercel" \
39
- -p "Build a todo app"
35
+ ```bash
36
+ agx new "<goal>" # Create task
37
+ agx run [task] # Run task (loads context, wakes agent)
38
+ agx tasks # Interactive TUI - browse all tasks
39
+ agx status # Current task status
40
+ agx context [task] # View task context
41
+ agx pause [task] # Pause task
42
+ agx remove [task] # Delete task (alias: rm, delete)
43
+ agx tail [task] # Live tail logs
40
44
  ```
41
45
 
42
- ## Output Markers
46
+ ### Interactive Tasks Browser
43
47
 
44
- Agents control state via markers in their output:
48
+ `agx tasks` opens a TUI showing all tasks with status, progress, and last run time.
45
49
 
46
- ```
47
- [checkpoint: Hero section complete] # Save progress
48
- [learn: Tailwind is fast] # Record learning
49
- [next: Add auth system] # Set next step
50
- [criteria: 2] # Mark criterion #2 done
51
- [approve: Deploy to production?] # Halt for approval
52
- [blocked: Need API key from client] # Mark stuck
53
- [pause] # Stop, resume later
54
- [continue] # Keep going (daemon)
55
- [done] # Task complete
56
- [split: auth "Handle authentication"] # Create subtask
50
+ Keys: `↑/↓` select, `enter` details, `r` run, `p` pause, `d` done, `x` remove
51
+
52
+ ## Steering: Nudge a Task
53
+
54
+ Send guidance to an agent for its next wake cycle:
55
+
56
+ ```bash
57
+ agx nudge <task> "focus on auth first" # Add nudge
58
+ agx nudge <task> # View pending nudges
57
59
  ```
58
60
 
59
- ## Providers
61
+ Nudges are shown to the agent on wake and then cleared.
60
62
 
61
- | Provider | Aliases | Description |
62
- |----------|---------|-------------|
63
- | claude | c, cl | Anthropic Claude Code |
64
- | gemini | g, gem | Google Gemini CLI |
65
- | ollama | o, ol | Local Ollama models |
63
+ ## Memory Commands (via mem)
66
64
 
67
- ## Options
65
+ Agents persist state using these commands:
68
66
 
67
+ ### Define Objective
68
+ ```bash
69
+ mem goal "<objective>" # Set/update goal
70
+ mem criteria add "<text>" # Add success criterion
71
+ mem constraint add "<rule>" # Add boundary/constraint
69
72
  ```
70
- --prompt, -p <text> Prompt to send
71
- --model, -m <name> Model name
72
- --yolo, -y Skip permission prompts
73
- --print Non-interactive output
74
- --interactive, -i Force interactive mode
75
- --mem Enable mem integration (auto-detected)
76
- --no-mem Disable mem integration
77
- --autonomous, -a Create task and run autonomously (starts daemon)
78
- --task <name> Specific task name
79
- --criteria <text> Success criterion (repeatable)
73
+
74
+ ### Track Progress
75
+ ```bash
76
+ mem next "<step>" # Set what you're working on
77
+ mem checkpoint "<msg>" # Save progress point
78
+ mem criteria <n> # Mark criterion #n complete
79
+ mem progress # Check progress %
80
+ ```
81
+
82
+ ### Learn & Adapt
83
+ ```bash
84
+ mem learn "<insight>" # Task-specific learning
85
+ mem learn -g "<insight>" # Global learning (all tasks)
86
+ mem stuck "<reason>" # Mark blocker
87
+ mem stuck clear # Clear blocker
80
88
  ```
81
89
 
82
- ## Claude Code Plugin
90
+ ### Build Playbook
91
+ ```bash
92
+ mem learnings -g # List global learnings
93
+ mem promote <n> # Promote learning to playbook
94
+ mem playbook # View global playbook
95
+ ```
83
96
 
84
- Install as a Claude Code plugin:
97
+ ### Query
98
+ ```bash
99
+ mem context # Full context for agent
100
+ mem history # Task progression
101
+ mem query "<search>" # Search all memory
102
+ ```
85
103
 
104
+ ### Complete
86
105
  ```bash
87
- claude plugin install github:ramarlina/agx
106
+ mem done # Mark task complete
88
107
  ```
89
108
 
90
- This adds:
91
- - **Skill**: Claude learns how to spawn background agents
92
- - **Commands**: `/agx:spawn <goal>`, `/agx:continue`
109
+ ## Agent Workflow
93
110
 
94
- ## Commands
111
+ When an agent wakes, it should:
95
112
 
96
- ```bash
97
- agx init # Setup wizard
98
- agx config # Configuration menu
99
- agx status # Show current config
100
- agx skill # View LLM skill
101
- agx skill install # Install skill to Claude/Gemini
113
+ 1. **Orient** - Read state (goal, criteria, progress, next step, nudges)
114
+ 2. **Plan** - Define criteria if missing, set intent with `mem next`
115
+ 3. **Execute** - Work toward criteria, save learnings
116
+ 4. **Checkpoint** - Save progress with `mem checkpoint`
117
+ 5. **Adapt** - Handle blockers or ask user for nudge
118
+
119
+ ## Daemon Mode
120
+
121
+ Run tasks automatically on a schedule:
102
122
 
103
- # Daemon management
123
+ ```bash
104
124
  agx daemon start # Start background daemon
105
125
  agx daemon stop # Stop daemon
106
126
  agx daemon status # Check if running
107
- agx daemon logs # Show recent logs
127
+ agx daemon logs # View logs
108
128
  ```
109
129
 
110
- ## Autonomous Mode
130
+ The daemon:
131
+ - Polls continuously for active tasks
132
+ - Runs up to 5 tasks in parallel
133
+ - Logs to `~/.agx/logs/<taskname>.log`
134
+
135
+ ## One-Shot Mode
111
136
 
112
- Start a task that runs autonomously until complete:
137
+ For quick questions without task creation:
113
138
 
114
139
  ```bash
115
- agx claude --autonomous -p "Build a React todo app with auth"
116
- # Created task: build-react-todo
117
- # ✓ Mapped: ~/Projects/app → task/build-react-todo
118
- # ✓ Daemon started (pid 12345)
119
- # ✓ Autonomous mode: daemon will continue work every 15m
140
+ agx -p "explain this error"
141
+ agx claude -p "refactor this function"
120
142
  ```
121
143
 
122
- The daemon:
123
- - Runs in background (survives terminal close)
124
- - Wakes every 15 minutes
125
- - Continues work on active tasks
126
- - Stops when task is `[done]` or `[blocked]`
127
-
128
- ## Loop Control
129
-
130
- The agent controls execution flow via markers:
131
-
132
- - `[done]` → Task complete, exit
133
- - `[pause]` → Save state, exit (resume later with same command)
134
- - `[blocked: reason]` → Mark stuck, notify human, exit
135
- - `[continue]` → Keep going (daemon mode loops)
136
- - `[approve: question]` → Halt until human approves
144
+ ## Providers
137
145
 
138
- ## Task Splitting
146
+ | Provider | Alias | Description |
147
+ |----------|-------|-------------|
148
+ | claude | c | Anthropic Claude Code |
149
+ | gemini | g | Google Gemini |
150
+ | ollama | o | Local Ollama |
139
151
 
140
- Break large tasks into subtasks:
152
+ ## Key Flags
141
153
 
154
+ ```bash
155
+ -a, --autonomous # Full auto: create task + daemon + work until done
156
+ -p, --prompt # The prompt/goal
157
+ -y, --yolo # Skip confirmations
158
+ --continue <task> # Continue specific task
142
159
  ```
143
- Agent output:
144
- This is too big. Breaking it down.
145
160
 
146
- [split: setup "Project scaffolding"]
147
- [split: auth "Authentication system"]
148
- [split: crud "CRUD operations"]
149
- [next: Start with setup subtask]
150
- [pause]
151
- ```
161
+ ## Key Principles
152
162
 
153
- agx creates subtask branches in ~/.mem linked to the parent.
163
+ - **Memory is everything** - Agents forget between sessions. Save state.
164
+ - **Criteria drive completion** - No criteria = no way to know when done.
165
+ - **Checkpoint often** - Sessions can die anytime.
166
+ - **Ask when stuck** - Get a nudge from the user vs. spinning.
167
+ - **Learn & promote** - Build the playbook for future tasks.
154
168
 
155
- ## Example: Full Workflow
169
+ ## Architecture
156
170
 
157
- ```bash
158
- # Day 1: Start project
159
- mkdir ~/Projects/my-app && cd ~/Projects/my-app
160
- agx claude --auto-task -p "Build a React todo app with auth"
161
-
162
- # Agent works, outputs markers
163
- # [checkpoint: Scaffolded with Vite]
164
- # [learn: Vite is faster than CRA]
165
- # [next: Add todo list component]
166
- # [pause]
167
-
168
- # Day 2: Continue
169
- cd ~/Projects/my-app
170
- agx claude -p "continue"
171
- # Context auto-loaded, agent picks up where it left off
171
+ ```
172
+ agx (agent execution)
173
+ ├── Uses mem CLI for all state operations
174
+ ├── Nudges via: mem set/get/pop
175
+ ├── Tasks via: mem tasks --json
176
+ └── Context via: mem context --json
177
+
178
+ mem (storage layer)
179
+ ├── Git-backed state in ~/.mem
180
+ ├── Branch per task
181
+ └── KV primitives (set/get/pop)
172
182
  ```
173
183
 
174
184
  ## License