Skip to content

Commit 8302064

Browse files
authored
docs(agentstack-cli): document adding agent from github (#1767)
* docs(agentstack-cli): document adding agent from github Signed-off-by: Jan Pokorný <[email protected]> * docs: add --dockerfile docs Signed-off-by: Jan Pokorný <[email protected]> --------- Signed-off-by: Jan Pokorný <[email protected]>
1 parent 5f97146 commit 8302064

File tree

3 files changed

+260
-1093
lines changed

3 files changed

+260
-1093
lines changed

apps/agentstack-cli/src/agentstack_cli/commands/agent.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,22 @@ async def add_agent(
159159
verbose: typing.Annotated[bool, typer.Option("-v", "--verbose", help="Show verbose output")] = False,
160160
yes: typing.Annotated[bool, typer.Option("--yes", "-y", help="Skip confirmation prompts.")] = False,
161161
) -> None:
162-
"""Add a docker image or GitHub repository [aliases: install]"""
162+
"""Add a docker image or GitHub repository.
163+
164+
This command supports a variety of GitHub URL formats for deploying agents:
165+
166+
- **Basic URL**: `https://github.com/myorg/myrepo`
167+
- **Git Protocol URL**: `git+https://github.com/myorg/myrepo`
168+
- **URL with .git suffix**: `https://github.com/myorg/myrepo.git`
169+
- **URL with Version Tag**: `https://github.com/myorg/[email protected]`
170+
- **URL with Branch Name**: `https://github.com/myorg/myrepo@my-branch`
171+
- **URL with Subfolder Path**: `https://github.com/myorg/myrepo#path=/path/to/agent`
172+
- **Combined Formats**: `https://github.com/myorg/[email protected]#path=/path/to/agent`
173+
- **Enterprise GitHub**: `https://github.mycompany.com/myorg/myrepo`
174+
- **With a custom Dockerfile location**: `agentstack add --dockerfile /my-agent/path/to/Dockerfile "https://github.com/my-org/my-awesome-agents@main#path=/my-agent"`
175+
176+
[aliases: install]
177+
"""
163178
if location is None:
164179
repo_input = (
165180
await inquirer.text( # pyright: ignore[reportPrivateImportUsage]

docs/development/deploy-agents/deploy-your-agents.mdx

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,39 @@ This automatically:
7777
**Why "copy into VM"?** Agent Stack runs in an isolated VM (Lima on Mac/Linux, WSL on Windows). Even though Docker Desktop builds your image, Agent Stack needs it copied into its VM to run it. The `add` command handles this automatically.
7878
</Note>
7979

80+
<Accordion title="Deploying from a GitHub Repository">
81+
You can also deploy an agent directly from a GitHub repository. The `agentstack add` command supports various URL formats to specify the repository, version, and location of your agent's code.
82+
83+
The supported formats include:
84+
- **Basic URL**: `https://github.com/myorg/myrepo`
85+
- **Git Protocol URL**: `git+https://github.com/myorg/myrepo`
86+
- **URL with .git suffix**: `https://github.com/myorg/myrepo.git`
87+
- **URL with Version Tag**: `https://github.com/myorg/[email protected]`
88+
- **URL with Branch Name**: `https://github.com/myorg/myrepo@my-branch`
89+
- **URL with Subfolder Path**: `https://github.com/myorg/myrepo#path=/path/to/agent`
90+
- **Combined Formats**: `https://github.com/myorg/[email protected]#path=/path/to/agent`
91+
- **Enterprise GitHub**: `https://github.mycompany.com/myorg/myrepo`
92+
93+
#### Example
94+
95+
To deploy an agent from a specific branch and subfolder, you would run:
96+
```bash
97+
agentstack add "https://github.com/my-org/my-awesome-agents@main#path=/my-agent"
98+
```
99+
100+
This command tells Agent Stack to:
101+
1. Fetch the `main` branch of the `my-awesome-agents` repository.
102+
2. Look for the agent's `Dockerfile` and source code in the `/my-agent` directory.
103+
3. Build the Docker image and register it with the platform.
104+
105+
106+
#### Example with `--dockerfile`
107+
108+
```bash
109+
agentstack add --dockerfile /my-agent/path/to/Dockerfile "https://github.com/my-org/my-awesome-agents@main#path=/my-agent"
110+
```
111+
</Accordion>
112+
80113
### Verify Deployment
81114

82115
Check that your agent is registered:

0 commit comments

Comments
 (0)