Skip to content

Commit 7abd73c

Browse files
committed
fix: cli command reference
1 parent bc1abbc commit 7abd73c

4 files changed

Lines changed: 28 additions & 33 deletions

File tree

src/console_and_cli.md

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,26 +24,29 @@ asterai auth status # Show current auth status
2424
### Component Commands
2525

2626
```bash
27-
asterai component init <name> # Create a new component project
28-
asterai component push # Push component to the registry (from project dir)
29-
asterai component pull <name> # Pull a component from the registry
30-
asterai component list # List your components
31-
asterai component pkg # Package the component's WIT into a WASM package
27+
asterai component init [name] [-l <language>] # Scaffold a new component project
28+
asterai component build # Build the component (from project dir)
29+
asterai component pkg # Package the component's WIT into a WASM package
30+
asterai component push # Push component to the registry (from project dir)
31+
asterai component pull <name> # Pull a component from the registry
32+
asterai component list # List your components
33+
asterai component delete <namespace:name> # Delete a component and all its versions
3234
```
3335

3436
### Environment Commands
3537

3638
```bash
37-
asterai env init <name> # Create a new environment
38-
asterai env run <name> # Run environment locally
39-
asterai env call <name> <component> <fn> [args] # Call a function
40-
asterai env push <name> # Push environment to registry
41-
asterai env pull <name> # Pull environment from registry
42-
asterai env list # List your environments
43-
asterai env inspect <name> # Show environment details
44-
asterai env add <name> --component <spec> # Add a component
45-
asterai env remove <name> --component <spec> # Remove a component
39+
asterai env init <name> [-e] # Create a new environment (-e to edit)
40+
asterai env edit <name> # Open environment in editor ($EDITOR or vi)
41+
asterai env call <name> <component> <fn> [args] # Call a function
42+
asterai env push <name> # Push environment to registry
43+
asterai env pull <name> # Pull environment from registry
44+
asterai env list # List your environments
45+
asterai env inspect <name> # Show environment details
46+
asterai env add-component <env> <component> # Add a component
47+
asterai env remove-component <env> <component> # Remove a component
4648
asterai env set-var <name> --var NAME=VALUE # Set environment variable
49+
asterai env delete <namespace:name> # Delete an environment (-r for registry)
4750
```
4851

4952
## ☁️ Cloud Console

src/environments.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ asterai env init my-env
2828
This creates an empty environment. Add components to it:
2929

3030
```bash
31-
asterai env add my-env --component your-username:hello-world@0.1.0
32-
asterai env add my-env --component other-user:useful-tool@1.2.0
31+
asterai env add-component my-env your-username:hello-world@0.1.0
32+
asterai env add-component my-env other-user:useful-tool@1.2.0
3333
```
3434

3535
## ⚙️ Configuration
@@ -99,8 +99,8 @@ processing component:
9999

100100
```bash
101101
asterai env init data-pipeline
102-
asterai env add data-pipeline --component your-username:web-scraper@1.0.0
103-
asterai env add data-pipeline --component your-username:data-processor@1.0.0
102+
asterai env add-component data-pipeline your-username:web-scraper@1.0.0
103+
asterai env add-component data-pipeline your-username:data-processor@1.0.0
104104
```
105105

106106
The data processor can import and call functions from the web scraper,
@@ -124,7 +124,7 @@ This shows:
124124
```bash
125125
asterai env list # List all your environments
126126
asterai env pull my-env # Pull an environment from the registry
127-
asterai env remove my-env --component your-username:hello-world@0.1.0 # Remove a component
127+
asterai env remove-component my-env your-username:hello-world@0.1.0 # Remove a component
128128
```
129129

130130
## 👉 Next Steps

src/hello_world.md

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ asterai auth status
4141
### 3. Create a new component
4242

4343
```bash
44-
asterai component init hello-world typescript
44+
asterai component init hello-world
4545
cd hello-world
4646
```
4747

@@ -119,28 +119,20 @@ Create a new environment and add your component to it:
119119

120120
```bash
121121
asterai env init my-env
122-
asterai env add my-env --component your-username:hello-world@0.1.0
122+
asterai env add-component my-env your-username:hello-world@0.1.0
123123
```
124124

125-
### 9. Run locally
125+
### 9. Call your function
126126

127-
Run the environment locally:
128-
129-
```bash
130-
asterai env run my-env
131-
```
132-
133-
### 10. Call your function
134-
135-
In another terminal, call your component's function:
127+
Call your component's function:
136128

137129
```bash
138130
asterai env call my-env your-username:hello-world hello-world.greet '"World"'
139131
```
140132

141133
You should see: `hello World!` 🎉
142134

143-
### 11. Push to the cloud (optional)
135+
### 10. Push to the cloud (optional)
144136

145137
To run your environment in the cloud, push it to the registry:
146138

src/registry.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Use them for proprietary tools or internal integrations.
3232
Publish a component with the CLI:
3333

3434
```bash
35-
asterai publish
35+
asterai component push
3636
```
3737

3838
The component version is defined in your `component.wit` file.

0 commit comments

Comments
 (0)