@moxxy/agent-cli 0.0.1 → 0.0.2

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.
Files changed (2) hide show
  1. package/README.md +134 -0
  2. package/package.json +3 -2
package/README.md ADDED
@@ -0,0 +1,134 @@
1
+ # @moxxy/agent-cli
2
+
3
+ Agent-facing CLI tool for structured operations. Part of the [Moxxy](https://github.com/webeferen/moxxy) orchestration platform.
4
+
5
+ Designed to be invoked by AI agents rather than humans. All output is JSON-structured for reliable parsing, with execution timing on every command.
6
+
7
+ ## Installation
8
+
9
+ ```bash
10
+ npm install -g @moxxy/agent-cli
11
+ ```
12
+
13
+ ## Quick Start
14
+
15
+ ```bash
16
+ # Clone and set up a workspace
17
+ moxxy-agent workspace init --repo https://github.com/owner/repo
18
+
19
+ # Read a file
20
+ moxxy-agent file read src/index.ts
21
+
22
+ # Search for a pattern
23
+ moxxy-agent search code "TODO|FIXME" --type ts
24
+
25
+ # Create a branch, make changes, commit, and open a PR
26
+ moxxy-agent git checkout -b fix/bug-123
27
+ moxxy-agent file patch src/app.ts --search "oldValue" --replace "newValue"
28
+ moxxy-agent git add --all
29
+ moxxy-agent git commit -m "fix: resolve bug 123"
30
+ moxxy-agent git push --set-upstream
31
+ moxxy-agent pr create --title "fix: resolve bug 123" --base main
32
+ ```
33
+
34
+ ## Structured Output
35
+
36
+ Every command returns a JSON `AgentCommandResult`:
37
+
38
+ ```jsonc
39
+ // Success
40
+ { "success": true, "command": "file read", "data": { ... }, "duration_ms": 12 }
41
+
42
+ // Failure
43
+ { "success": false, "command": "file read", "error": { "code": "NOT_FOUND", "message": "..." }, "duration_ms": 3 }
44
+ ```
45
+
46
+ ## Commands
47
+
48
+ ### Workspace
49
+
50
+ | Command | Description |
51
+ |---------|-------------|
52
+ | `workspace init --repo <url> [--branch <b>] [--clone-dir <p>]` | Clone repo and set up workspace |
53
+ | `workspace info` | Show workspace context (cwd, git, package manager) |
54
+ | `workspace clean <path>` | Remove workspace directory |
55
+
56
+ ### File
57
+
58
+ | Command | Description |
59
+ |---------|-------------|
60
+ | `file create <path> --content <c>` | Create a new file |
61
+ | `file read <path> [--lines start:end]` | Read file contents |
62
+ | `file update <path> --content <c>` | Overwrite file contents |
63
+ | `file delete <path>` | Delete a file |
64
+ | `file move <source> <dest>` | Move or rename a file |
65
+ | `file patch <path> --search <s> --replace <r>` | Find-and-replace in a file |
66
+
67
+ Both `file create` and `file update` accept `--from-stdin` to read content from stdin.
68
+
69
+ ### Directory
70
+
71
+ | Command | Description |
72
+ |---------|-------------|
73
+ | `dir list [path] [--recursive] [--pattern <glob>]` | List directory contents |
74
+ | `dir create <path>` | Create directory (with parents) |
75
+ | `dir delete <path>` | Remove directory |
76
+ | `dir tree [path] [--depth <n>]` | Display directory tree |
77
+
78
+ ### Git
79
+
80
+ | Command | Description |
81
+ |---------|-------------|
82
+ | `git init [path]` | Initialize a repository |
83
+ | `git clone <url> [dir] [--branch <b>]` | Clone a repository |
84
+ | `git branch [name] [--list]` | Create or list branches |
85
+ | `git checkout <branch> [-b]` | Switch branches (optionally create) |
86
+ | `git add [files] [--all]` | Stage files |
87
+ | `git commit -m <message>` | Commit staged changes |
88
+ | `git push [--set-upstream] [--remote <r>] [--branch <b>]` | Push to remote |
89
+ | `git pull` | Pull from remote |
90
+ | `git diff [--staged]` | Show changes |
91
+ | `git status` | Show working tree status |
92
+ | `git log [--limit <n>]` | Show commit history |
93
+
94
+ ### Search
95
+
96
+ | Command | Description |
97
+ |---------|-------------|
98
+ | `search code <query> [--path <dir>] [--type <ext>]` | Search for code patterns (regex) |
99
+ | `search files <pattern> [--path <dir>]` | Find files by glob pattern |
100
+ | `search docs <query> [--path <dir>]` | Search documentation files |
101
+
102
+ ### Pull Requests
103
+
104
+ | Command | Description |
105
+ |---------|-------------|
106
+ | `pr create --title <t> [--body <b>] [--base <branch>]` | Create a pull request |
107
+ | `pr comment <number> --body <text>` | Comment on a pull request |
108
+
109
+ ### Workflow
110
+
111
+ | Command | Description |
112
+ |---------|-------------|
113
+ | `workflow run <workflow-file>` | Run a workflow from a JSON definition |
114
+ | `workflow status` | Show status of running workflows |
115
+
116
+ ### Global Options
117
+
118
+ | Flag | Description |
119
+ |------|-------------|
120
+ | `--cwd <path>` | Override working directory |
121
+ | `--verbose` | Enable verbose logging |
122
+
123
+ ## Plugin Architecture
124
+
125
+ The CLI is built on a plugin system. Each built-in plugin (workspace, file, dir, git, search, pr, workflow) implements `IAgentPlugin` and registers its commands dynamically.
126
+
127
+ ```typescript
128
+ import { PluginRegistry } from '@moxxy/agent-cli';
129
+ import type { IAgentPlugin } from '@moxxy/agent-cli';
130
+ ```
131
+
132
+ ## License
133
+
134
+ MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moxxy/agent-cli",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "description": "Agent-facing CLI tool for structured operations",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -21,7 +21,8 @@
21
21
  },
22
22
  "files": [
23
23
  "dist",
24
- "bin"
24
+ "bin",
25
+ "README.md"
25
26
  ],
26
27
  "main": "./dist/index.js",
27
28
  "module": "./dist/index.mjs",