@agent-commons/cli 0.3.0 → 0.4.0

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 (4) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +206 -0
  3. package/dist/bin.js +1218 -469
  4. package/package.json +25 -4
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Agent Commons
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,206 @@
1
+ # `@agent-commons/cli`
2
+
3
+ The official command-line interface for Agent Commons. Build, run, inspect, and
4
+ operate agents without leaving the terminal.
5
+
6
+ ```text
7
+
8
+ ╭───┴────────────────────────────────╮
9
+ │ AGENT COMMONS // CLI │
10
+ ╰────────────────────────────────────╯
11
+ Build · run · connect · collaborate
12
+ ```
13
+
14
+ ## Install
15
+
16
+ Install globally:
17
+
18
+ ```bash
19
+ npm install --global @agent-commons/cli
20
+ ```
21
+
22
+ Or run without installing:
23
+
24
+ ```bash
25
+ npx @agent-commons/cli --help
26
+ ```
27
+
28
+ The executable is `agc`. Node.js 18 or newer is required.
29
+
30
+ ## Sign in
31
+
32
+ ```bash
33
+ agc login
34
+ ```
35
+
36
+ The CLI opens Commons Identity in your browser and displays a one-time device
37
+ code. Approve it with your existing Commons account; your password never enters
38
+ the terminal.
39
+
40
+ Credentials are stored in `~/.agc/config.json` with user-only file permissions.
41
+ Short-lived API access tokens are refreshed from the Commons account session.
42
+
43
+ Verify the active account:
44
+
45
+ ```bash
46
+ agc whoami
47
+ ```
48
+
49
+ Sign out:
50
+
51
+ ```bash
52
+ agc logout
53
+ ```
54
+
55
+ For CI or other non-interactive automation, use a project-scoped developer key:
56
+
57
+ ```bash
58
+ agc login --api-key "$AGENT_COMMONS_API_KEY"
59
+ ```
60
+
61
+ Interactive CLI use should prefer account sign-in. API keys are designed for
62
+ SDKs, servers, CI, and automation.
63
+
64
+ ## Command center
65
+
66
+ Run `agc` with no arguments to open the interactive command center:
67
+
68
+ ```bash
69
+ agc
70
+ ```
71
+
72
+ It guides first-time sign-in, lets you select an agent, and provides shortcuts
73
+ to the main platform areas.
74
+
75
+ ## Everyday commands
76
+
77
+ ```bash
78
+ # Agents
79
+ agc agents list
80
+ agc agents create --name "Researcher" --instructions "Research carefully"
81
+ agc agents runtime status agt_...
82
+
83
+ # Run and chat
84
+ agc run --agent agt_... "Summarize this week"
85
+ agc chat --agent agt_...
86
+
87
+ # Sessions and tasks
88
+ agc sessions list
89
+ agc sessions rename ses_... "Launch research"
90
+ agc task list
91
+
92
+ # Workflows
93
+ agc workflow list
94
+ agc workflow run wfl_... --input '{"topic":"agents"}'
95
+
96
+ # Persistent agent computer
97
+ agc computer status --agent agt_...
98
+ agc computer wake --agent agt_...
99
+ agc computer exec --agent agt_... pnpm test
100
+
101
+ # Platform resources
102
+ agc library list
103
+ agc library upload ./brief.pdf --agent agt_...
104
+ agc projects list --agent agt_...
105
+ agc connections list
106
+ agc mcp list
107
+ agc skills list
108
+ agc memory stats --agent agt_...
109
+ agc logs list --agent agt_...
110
+ ```
111
+
112
+ Most list and detail commands support `--json` for scripts and pipelines.
113
+
114
+ ## Developer projects and API keys
115
+
116
+ Developer keys are project-scoped `csk_*` credentials. Projects isolate
117
+ environments, scopes, usage, and revocation.
118
+
119
+ ```bash
120
+ # List projects and supported scopes
121
+ agc keys projects list
122
+ agc keys scopes
123
+
124
+ # Create a development project
125
+ agc keys projects create \
126
+ --name "Local development" \
127
+ --environment development
128
+
129
+ # Create a least-privilege key
130
+ agc keys create \
131
+ --name "Nightly agent run" \
132
+ --project prj_... \
133
+ --scopes agents:read,agents:run \
134
+ --expires 2027-01-01T00:00:00Z
135
+
136
+ # Inspect and revoke
137
+ agc keys list --project prj_...
138
+ agc keys revoke key_...
139
+ ```
140
+
141
+ The plaintext key is shown once. Store it in a secret manager or protected
142
+ environment variable.
143
+
144
+ ## Connected accounts
145
+
146
+ Agents use Commons-managed OAuth connections instead of copied third-party
147
+ tokens:
148
+
149
+ ```bash
150
+ agc connections providers
151
+ agc connections connect github
152
+ agc connections list
153
+ agc connections test conn_...
154
+ agc connections refresh conn_...
155
+ agc connections revoke conn_...
156
+ ```
157
+
158
+ ## Local tools
159
+
160
+ `agc run` and `agc chat` can expose approved local terminal, file, and Git
161
+ operations to an agent. Use the relevant local-tool flags shown by
162
+ `agc run --help` and review the requested scope before enabling write or
163
+ execution access.
164
+
165
+ ## Configuration and environment variables
166
+
167
+ ```bash
168
+ agc config get
169
+ agc config set defaultAgentId agt_...
170
+ ```
171
+
172
+ | Variable | Purpose |
173
+ | --- | --- |
174
+ | `AGC_API_URL` | Override the Agent Commons API origin |
175
+ | `AGC_API_KEY` | Project API key for non-interactive use |
176
+ | `AGC_AGENT_ID` | Default agent ID |
177
+ | `AGC_INITIATOR` | Optional delegated principal |
178
+ | `COMMONS_IDENTITY_URL` | Override the Commons Identity origin |
179
+ | `COMMONS_ACCESS_TOKEN` | Supply an existing short-lived access token |
180
+
181
+ Environment variables override the local configuration file and are not copied
182
+ into it when preferences are updated.
183
+
184
+ ## Security
185
+
186
+ - Prefer `agc login` on developer machines.
187
+ - Use project-scoped keys for CI and servers.
188
+ - Keep production and development keys in different projects.
189
+ - Grant only the required scopes and set an expiration where practical.
190
+ - Run `agc logout` before sharing or decommissioning a machine.
191
+
192
+ ## Help and links
193
+
194
+ ```bash
195
+ agc --help
196
+ agc <command> --help
197
+ ```
198
+
199
+ - [Documentation](https://docs.agentcommons.io)
200
+ - [Agent Commons](https://www.agentcommons.io)
201
+ - [GitHub](https://github.com/Arttribute/agent-commons)
202
+ - [Issues](https://github.com/Arttribute/agent-commons/issues)
203
+
204
+ ## License
205
+
206
+ MIT