@guildai/cli 0.5.3 → 0.5.5
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/LICENSE +191 -0
- package/README.md +190 -42
- package/dist/commands/agent/chat.js +5 -5
- package/dist/commands/agent/save.js +57 -5
- package/dist/commands/agent/test.js +5 -5
- package/dist/commands/chat.js +15 -1
- package/dist/commands/config/set.js +19 -27
- package/dist/commands/session/list.js +1 -1
- package/dist/lib/api-client.d.ts +0 -3
- package/dist/lib/api-client.js +0 -2
- package/dist/lib/owner-helpers.d.ts +5 -0
- package/dist/lib/owner-helpers.js +31 -25
- package/docs/DESIGN.md +27 -61
- package/package.json +4 -4
- package/dist/lib/formatters.d.ts +0 -44
- package/dist/lib/formatters.js +0 -51
- package/docs/getting-started.md +0 -440
- package/docs/output-format.md +0 -126
- package/docs/session-events.md +0 -143
package/LICENSE
ADDED
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to the Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by the Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding any notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
Copyright 2026 Guild.ai
|
|
180
|
+
|
|
181
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
182
|
+
you may not use this file except in compliance with the License.
|
|
183
|
+
You may obtain a copy of the License at
|
|
184
|
+
|
|
185
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
186
|
+
|
|
187
|
+
Unless required by applicable law or agreed to in writing, software
|
|
188
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
189
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
190
|
+
See the License for the specific language governing permissions and
|
|
191
|
+
limitations under the License.
|
package/README.md
CHANGED
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
Command-line interface for [Guild.ai](https://guild.ai) — build, test, and deploy AI agents.
|
|
4
4
|
|
|
5
|
+
## Prerequisites
|
|
6
|
+
|
|
7
|
+
- **Node.js 18+** and **npm** — [nodejs.org](https://nodejs.org)
|
|
8
|
+
- **A Guild account** — Guild.ai is in closed beta. Request an invitation at hello@guild.ai
|
|
9
|
+
|
|
5
10
|
## Installation
|
|
6
11
|
|
|
7
12
|
```bash
|
|
@@ -16,68 +21,126 @@ npm install -g @guildai/cli
|
|
|
16
21
|
guild auth login
|
|
17
22
|
```
|
|
18
23
|
|
|
19
|
-
|
|
24
|
+
This opens your browser to complete sign-in at [app.guild.ai](https://app.guild.ai). It also configures your local npm registry so the CLI can install Guild packages.
|
|
25
|
+
|
|
26
|
+
Verify:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
guild auth status
|
|
30
|
+
```
|
|
20
31
|
|
|
21
|
-
### 2.
|
|
32
|
+
### 2. Select a workspace
|
|
22
33
|
|
|
23
34
|
```bash
|
|
24
|
-
|
|
25
|
-
guild agent init --name my-agent
|
|
35
|
+
guild workspace select
|
|
26
36
|
```
|
|
27
37
|
|
|
28
|
-
|
|
38
|
+
If you have one workspace, it's selected automatically. If you have several, pick one from the list.
|
|
39
|
+
|
|
40
|
+
### 3. Create an agent
|
|
29
41
|
|
|
30
42
|
```bash
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
43
|
+
mkdir hello-agent && cd hello-agent
|
|
44
|
+
guild agent init --name hello-agent --template LLM
|
|
45
|
+
```
|
|
34
46
|
|
|
35
|
-
|
|
36
|
-
|
|
47
|
+
This creates the agent in the Guild backend, initializes a local git repo, and pulls starter files:
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
hello-agent/
|
|
51
|
+
├── agent.ts # Your agent code
|
|
52
|
+
├── package.json # Dependencies
|
|
53
|
+
├── tsconfig.json # TypeScript config
|
|
54
|
+
├── guild.json # Local config (managed by the CLI, don't edit)
|
|
55
|
+
└── .gitignore
|
|
37
56
|
```
|
|
38
57
|
|
|
39
|
-
### 4.
|
|
58
|
+
### 4. Edit the agent
|
|
59
|
+
|
|
60
|
+
Open `agent.ts` and replace the contents:
|
|
61
|
+
|
|
62
|
+
```typescript
|
|
63
|
+
import { llmAgent, guildTools, userInterfaceTools } from '@guildai/agents-sdk';
|
|
64
|
+
|
|
65
|
+
export default llmAgent({
|
|
66
|
+
description: 'A friendly greeting agent',
|
|
67
|
+
tools: { ...guildTools, ...userInterfaceTools },
|
|
68
|
+
systemPrompt: `You are a friendly assistant. Greet users warmly and answer their questions.`,
|
|
69
|
+
mode: 'multi-turn',
|
|
70
|
+
});
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### 5. Test it
|
|
40
74
|
|
|
41
75
|
```bash
|
|
42
|
-
guild agent test
|
|
76
|
+
guild agent test --ephemeral
|
|
43
77
|
```
|
|
44
78
|
|
|
45
|
-
|
|
79
|
+
Type a message and press Enter. Press `Ctrl+C` to exit.
|
|
80
|
+
|
|
81
|
+
### 6. Save and publish
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
guild agent save --message "First version" --wait --publish
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
- `--wait` blocks until validation passes
|
|
88
|
+
- `--publish` makes the agent available in the Guild catalog
|
|
89
|
+
|
|
90
|
+
## Templates
|
|
91
|
+
|
|
92
|
+
| Template | Use when |
|
|
93
|
+
| -------------------- | -------------------------------------------------------------------- |
|
|
94
|
+
| `LLM` | The LLM is the logic. You write a prompt and pick tools. Start here. |
|
|
95
|
+
| `AUTO_MANAGED_STATE` | You write procedural TypeScript that calls tools inline. |
|
|
96
|
+
| `BLANK` | You want full control over the agent lifecycle. |
|
|
97
|
+
|
|
98
|
+
## Development Loop
|
|
99
|
+
|
|
100
|
+
The typical workflow: pull → edit → test → save.
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
guild agent pull # Sync remote changes
|
|
104
|
+
# ... edit agent.ts ...
|
|
105
|
+
guild agent test # Interactive test session
|
|
106
|
+
guild agent save --message "Add Slack notifications" # Save as draft
|
|
107
|
+
guild agent save --message "Ready" --wait --publish # Save + validate + publish
|
|
108
|
+
```
|
|
46
109
|
|
|
47
110
|
## Commands
|
|
48
111
|
|
|
49
112
|
### Authentication
|
|
50
113
|
|
|
51
114
|
```bash
|
|
52
|
-
guild auth login
|
|
53
|
-
guild auth logout
|
|
54
|
-
guild auth status
|
|
115
|
+
guild auth login # OAuth device flow login
|
|
116
|
+
guild auth logout # Remove stored token
|
|
117
|
+
guild auth status # Check authentication status
|
|
118
|
+
guild auth token # Print auth token to stdout (for scripting)
|
|
55
119
|
```
|
|
56
120
|
|
|
57
121
|
### Agents
|
|
58
122
|
|
|
59
123
|
```bash
|
|
60
124
|
guild agent init --name my-agent # Initialize a new agent
|
|
61
|
-
guild agent clone <
|
|
62
|
-
guild agent save # Push commits and create a version
|
|
63
|
-
guild agent save -A --message "..." # Stage+commit+push in one step
|
|
125
|
+
guild agent clone <identifier> # Clone an existing agent
|
|
64
126
|
guild agent pull # Pull remote changes
|
|
65
|
-
guild agent
|
|
66
|
-
guild agent
|
|
67
|
-
guild agent chat "message" # Send a single message
|
|
68
|
-
guild agent get [agent-id] # Get agent details
|
|
69
|
-
guild agent versions [agent-id] # List versions
|
|
70
|
-
guild agent code [agent-id] # View latest published source
|
|
71
|
-
guild agent list # List all agents
|
|
72
|
-
guild agent grep <pattern> # Search agent source code
|
|
127
|
+
guild agent save --message "..." # Save changes (creates draft version)
|
|
128
|
+
guild agent save --message "..." --wait --publish # Save + validate + publish
|
|
73
129
|
guild agent publish # Publish latest draft version
|
|
74
|
-
guild agent unpublish #
|
|
75
|
-
guild agent
|
|
76
|
-
guild agent
|
|
130
|
+
guild agent unpublish # Unpublish latest published version
|
|
131
|
+
guild agent test # Interactive test session
|
|
132
|
+
guild agent test --ephemeral # Test uncommitted changes
|
|
133
|
+
guild agent chat "Hello" # Send a single message
|
|
134
|
+
guild agent get [identifier] # Get agent details
|
|
135
|
+
guild agent versions [identifier] # List version history
|
|
136
|
+
guild agent code [identifier] # Fetch latest published code
|
|
137
|
+
guild agent list # List all agents
|
|
138
|
+
guild agent search <query> # Search published agents
|
|
139
|
+
guild agent grep <pattern> # Search agent code files
|
|
140
|
+
guild agent fork <agent-id>:<version> # Fork an existing agent version
|
|
77
141
|
guild agent owners # List accounts that can own agents
|
|
78
|
-
guild agent tags list
|
|
79
|
-
guild agent
|
|
80
|
-
guild agent tags remove <tag...> # Remove tags
|
|
142
|
+
guild agent tags list|add|remove # Manage agent tags
|
|
143
|
+
guild agent revalidate # Re-run validation
|
|
81
144
|
```
|
|
82
145
|
|
|
83
146
|
### Workspaces
|
|
@@ -97,6 +160,29 @@ guild workspace context edit # Edit context (opens editor)
|
|
|
97
160
|
guild workspace context publish # Publish draft context
|
|
98
161
|
```
|
|
99
162
|
|
|
163
|
+
### Sessions
|
|
164
|
+
|
|
165
|
+
```bash
|
|
166
|
+
guild session list # List sessions in a workspace
|
|
167
|
+
guild session get <session-id> # Get session details
|
|
168
|
+
guild session events <session-id> # List events in a session
|
|
169
|
+
guild session tasks <session-id> # List tasks in a session
|
|
170
|
+
guild session create # Create a new session
|
|
171
|
+
guild session send <session-id> # Send a message to a session
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
### Triggers
|
|
175
|
+
|
|
176
|
+
```bash
|
|
177
|
+
guild trigger list # List triggers in a workspace
|
|
178
|
+
guild trigger get <trigger-id> # Get trigger details
|
|
179
|
+
guild trigger create # Create a new trigger
|
|
180
|
+
guild trigger update <trigger-id> # Update a trigger
|
|
181
|
+
guild trigger activate <trigger-id> # Activate a trigger
|
|
182
|
+
guild trigger deactivate <trigger-id> # Deactivate a trigger
|
|
183
|
+
guild trigger sessions <trigger-id> # List sessions spawned by a trigger
|
|
184
|
+
```
|
|
185
|
+
|
|
100
186
|
### Chat
|
|
101
187
|
|
|
102
188
|
```bash
|
|
@@ -105,6 +191,29 @@ guild chat "your message" # One-shot message
|
|
|
105
191
|
guild chat --agent <agent-id> # Chat with specific agent
|
|
106
192
|
```
|
|
107
193
|
|
|
194
|
+
### Configuration
|
|
195
|
+
|
|
196
|
+
```bash
|
|
197
|
+
guild config list # Show all configuration values
|
|
198
|
+
guild config get <key> # Get a configuration value
|
|
199
|
+
guild config set <key> <value> # Set a global configuration value
|
|
200
|
+
guild config path # Show configuration file paths
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
### Diagnostics
|
|
204
|
+
|
|
205
|
+
```bash
|
|
206
|
+
guild doctor # Check CLI setup and diagnose issues
|
|
207
|
+
guild version # Show version info
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
### Coding Assistant Skills
|
|
211
|
+
|
|
212
|
+
```bash
|
|
213
|
+
guild setup # Install Guild skills for coding assistants
|
|
214
|
+
guild setup --claude-md # Also create a CLAUDE.md template
|
|
215
|
+
```
|
|
216
|
+
|
|
108
217
|
## Configuration
|
|
109
218
|
|
|
110
219
|
**Global config** (`~/.guild/config.json`):
|
|
@@ -134,28 +243,67 @@ OAuth tokens are stored in your system's secure credential store:
|
|
|
134
243
|
|
|
135
244
|
## Troubleshooting
|
|
136
245
|
|
|
137
|
-
###
|
|
246
|
+
### "Connection refused" or "Cannot connect to server"
|
|
247
|
+
|
|
248
|
+
1. Check your internet connection
|
|
249
|
+
2. Run `guild doctor` to see which check is failing
|
|
250
|
+
|
|
251
|
+
### "Not authenticated"
|
|
138
252
|
|
|
139
253
|
```bash
|
|
140
|
-
guild auth
|
|
141
|
-
guild auth
|
|
142
|
-
guild auth login # Re-authenticate
|
|
254
|
+
guild auth login
|
|
255
|
+
guild auth status
|
|
143
256
|
```
|
|
144
257
|
|
|
145
|
-
###
|
|
258
|
+
### "Workspace not found" or wrong workspace
|
|
259
|
+
|
|
260
|
+
```bash
|
|
261
|
+
guild workspace select
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
Or override for a single command:
|
|
265
|
+
|
|
266
|
+
```bash
|
|
267
|
+
GUILD_WORKSPACE_ID=<workspace-id> guild agent test
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
### "No agent ID provided and not in an agent directory"
|
|
271
|
+
|
|
272
|
+
Either run from inside an agent directory (one with a `guild.json` file), or pass the agent ID explicitly:
|
|
273
|
+
|
|
274
|
+
```bash
|
|
275
|
+
guild agent get <agent-id>
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
### "No changes to commit"
|
|
279
|
+
|
|
280
|
+
All changes are already committed. Make a code change first, then run `guild agent save` again.
|
|
281
|
+
|
|
282
|
+
### Validation failures
|
|
283
|
+
|
|
284
|
+
```bash
|
|
285
|
+
guild agent versions --limit 1 # Check for errors
|
|
286
|
+
# Fix the issue, then:
|
|
287
|
+
guild agent save --message "Fix" --wait
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
### Agent test not responding
|
|
291
|
+
|
|
292
|
+
1. Check your agent code compiles — look for TypeScript errors in `agent.ts`
|
|
293
|
+
2. Make sure you've saved at least once: `guild agent save --message "initial"`
|
|
294
|
+
3. Try a single message instead: `guild agent chat "hello"`
|
|
146
295
|
|
|
147
|
-
|
|
296
|
+
### Keychain issues
|
|
148
297
|
|
|
149
298
|
- **macOS**: Ensure Keychain Access is working and not locked
|
|
150
299
|
- **Linux**: Install and configure libsecret (e.g., `gnome-keyring`)
|
|
151
300
|
- **Windows**: Check Credential Manager is accessible
|
|
152
301
|
|
|
153
|
-
### Command
|
|
302
|
+
### Command not found
|
|
154
303
|
|
|
155
304
|
Ensure npm global bin directory is in your PATH:
|
|
156
305
|
|
|
157
306
|
```bash
|
|
158
|
-
npm config get prefix
|
|
159
307
|
export PATH="$(npm config get prefix)/bin:$PATH"
|
|
160
308
|
```
|
|
161
309
|
|
|
@@ -166,4 +314,4 @@ export PATH="$(npm config get prefix)/bin:$PATH"
|
|
|
166
314
|
|
|
167
315
|
## License
|
|
168
316
|
|
|
169
|
-
|
|
317
|
+
MIT
|
|
@@ -3,7 +3,7 @@ import { Command } from 'commander';
|
|
|
3
3
|
import { render } from 'ink';
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import open from 'open';
|
|
6
|
-
import
|
|
6
|
+
import { hyperlink } from '../../lib/colors.js';
|
|
7
7
|
import { getAgentId, readAgentFiles } from '../../lib/agent-helpers.js';
|
|
8
8
|
import { ChatApp, createSession, ensureAuthenticated } from '../chat.js';
|
|
9
9
|
import { readFileSync } from 'fs';
|
|
@@ -172,10 +172,10 @@ export function createAgentChatCommand() {
|
|
|
172
172
|
const session = await createSession(client, options.workspace, initialPrompt, version.id);
|
|
173
173
|
if (!quiet) {
|
|
174
174
|
console.log(`✓ Agent: ${config?.name || agentId}`);
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
}
|
|
175
|
+
const sessionLink = session.session_url
|
|
176
|
+
? hyperlink(session.id, session.session_url)
|
|
177
|
+
: session.id;
|
|
178
|
+
console.log(`✓ Session: ${sessionLink}`);
|
|
179
179
|
console.log('');
|
|
180
180
|
}
|
|
181
181
|
if (options.open && session.session_url) {
|
|
@@ -17,13 +17,29 @@ export function createAgentSaveCommand() {
|
|
|
17
17
|
.option('--message <text>', 'Commit message (required with --all)')
|
|
18
18
|
.option('--wait', 'Wait for validation to complete before returning', false)
|
|
19
19
|
.option('--publish', 'Publish after validation passes (implies --wait)', false)
|
|
20
|
+
.option('--bump [level]', 'Bump package.json version before saving (patch, or minor/major)', 'patch')
|
|
21
|
+
.option('--no-bump', 'Skip automatic version bump')
|
|
20
22
|
.option('--json', 'Output JSON only (no progress messages)', false)
|
|
21
23
|
.action(async (options) => {
|
|
22
24
|
const cwd = process.cwd();
|
|
23
25
|
let guildConfig = null;
|
|
24
26
|
const output = createOutputWriter();
|
|
25
|
-
//
|
|
26
|
-
|
|
27
|
+
// Resolve bump level: bare --bump defaults to 'patch', --no-bump skips
|
|
28
|
+
const bumpLevel = options.bump === true || options.bump === 'patch'
|
|
29
|
+
? 'patch'
|
|
30
|
+
: options.bump === 'minor'
|
|
31
|
+
? 'minor'
|
|
32
|
+
: options.bump === 'major'
|
|
33
|
+
? 'major'
|
|
34
|
+
: options.bump === false
|
|
35
|
+
? null
|
|
36
|
+
: null;
|
|
37
|
+
if (options.bump !== false && bumpLevel === null) {
|
|
38
|
+
output.error(`Invalid bump level: ${String(options.bump)}`, 'Valid levels are: patch, minor, major\n guild agent save --bump minor');
|
|
39
|
+
process.exit(1);
|
|
40
|
+
}
|
|
41
|
+
// With --all, a commit message is required (unless bump auto-generates one)
|
|
42
|
+
if (options.all && !options.message && !bumpLevel) {
|
|
27
43
|
output.error('Commit message is required with --all', 'Provide a message describing your changes:\n guild agent save -A --message "Add new feature"');
|
|
28
44
|
process.exit(1);
|
|
29
45
|
}
|
|
@@ -40,6 +56,39 @@ export function createAgentSaveCommand() {
|
|
|
40
56
|
}
|
|
41
57
|
// Read guild.json
|
|
42
58
|
guildConfig = JSON.parse(await fs.readFile(guildJsonPath, 'utf-8'));
|
|
59
|
+
// Handle --bump: bump package.json version before git operations
|
|
60
|
+
if (bumpLevel) {
|
|
61
|
+
const packageJsonPath = path.join(cwd, 'package.json');
|
|
62
|
+
let packageJsonContent;
|
|
63
|
+
try {
|
|
64
|
+
packageJsonContent = await fs.readFile(packageJsonPath, 'utf-8');
|
|
65
|
+
}
|
|
66
|
+
catch {
|
|
67
|
+
output.error('package.json not found', 'A package.json file is required in the agent directory to use --bump.');
|
|
68
|
+
process.exit(1);
|
|
69
|
+
}
|
|
70
|
+
const packageJson = JSON.parse(packageJsonContent);
|
|
71
|
+
const currentVersion = packageJson.version || '0.0.0';
|
|
72
|
+
const parts = currentVersion.split('.').map(Number);
|
|
73
|
+
if (parts.length !== 3 || parts.some((p) => isNaN(p))) {
|
|
74
|
+
output.error(`Cannot bump invalid version: ${currentVersion}`, 'package.json version must be in MAJOR.MINOR.PATCH format (e.g. 1.0.0)');
|
|
75
|
+
process.exit(1);
|
|
76
|
+
}
|
|
77
|
+
const [major, minor, patch] = parts;
|
|
78
|
+
let newVersion;
|
|
79
|
+
if (bumpLevel === 'major') {
|
|
80
|
+
newVersion = `${major + 1}.0.0`;
|
|
81
|
+
}
|
|
82
|
+
else if (bumpLevel === 'minor') {
|
|
83
|
+
newVersion = `${major}.${minor + 1}.0`;
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
newVersion = `${major}.${minor}.${patch + 1}`;
|
|
87
|
+
}
|
|
88
|
+
packageJson.version = newVersion;
|
|
89
|
+
await fs.writeFile(packageJsonPath, JSON.stringify(packageJson, null, 2) + '\n');
|
|
90
|
+
output.progress(`✓ Bumped version: ${currentVersion} → ${newVersion}`);
|
|
91
|
+
}
|
|
43
92
|
// Check for uncommitted changes and unpushed commits
|
|
44
93
|
const { stdout: statusOutput } = await runGit(['status', '--porcelain'], {
|
|
45
94
|
cwd,
|
|
@@ -65,12 +114,15 @@ export function createAgentSaveCommand() {
|
|
|
65
114
|
hasUnpushedCommits = false;
|
|
66
115
|
}
|
|
67
116
|
}
|
|
68
|
-
|
|
69
|
-
|
|
117
|
+
// --bump implies --all (the version change needs to be committed)
|
|
118
|
+
const shouldStageAll = options.all || !!bumpLevel;
|
|
119
|
+
if (shouldStageAll) {
|
|
120
|
+
// Stage and commit before pushing
|
|
70
121
|
if (hasUncommittedChanges) {
|
|
71
122
|
await runGit(['add', '-A'], { cwd });
|
|
72
123
|
output.progress('✓ Staged changes');
|
|
73
|
-
|
|
124
|
+
const commitMsg = options.message || (bumpLevel ? `Bump version` : '');
|
|
125
|
+
await runGit(['commit', '-m', commitMsg], { cwd });
|
|
74
126
|
output.progress('✓ Committed locally');
|
|
75
127
|
hasUnpushedCommits = true;
|
|
76
128
|
}
|
|
@@ -6,7 +6,7 @@ import { readFileSync } from 'fs';
|
|
|
6
6
|
import path from 'path';
|
|
7
7
|
import { fileURLToPath } from 'url';
|
|
8
8
|
import open from 'open';
|
|
9
|
-
import
|
|
9
|
+
import { hyperlink } from '../../lib/colors.js';
|
|
10
10
|
import { GuildAPIClient } from '../../lib/api-client.js';
|
|
11
11
|
import { handleAxiosError, ErrorCodes } from '../../lib/errors.js';
|
|
12
12
|
import { format } from '../../lib/progress.js';
|
|
@@ -284,10 +284,10 @@ export function createAgentTestCommand() {
|
|
|
284
284
|
: commitSha?.substring(0, 12) || 'unknown';
|
|
285
285
|
console.log(`✓ Version: ${versionDisplay}`);
|
|
286
286
|
console.log(`✓ Workspace: ${workspaceId}`);
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
}
|
|
287
|
+
const sessionLink = session.session_url
|
|
288
|
+
? hyperlink(session.id, session.session_url)
|
|
289
|
+
: session.id;
|
|
290
|
+
console.log(`✓ Session: ${sessionLink}`);
|
|
291
291
|
console.log('');
|
|
292
292
|
}
|
|
293
293
|
if (options.open && session.session_url) {
|