Skip to content

Commit 66676db

Browse files
authored
docs: update end user documentation (#271)
1 parent 98ed3b5 commit 66676db

28 files changed

+3900
-1052
lines changed

.claude/CLAUDE.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,9 @@ These constants are defined in `crates/icp/src/prelude.rs` as `LOCAL` and `IC` a
125125
#### Identity & Canister IDs
126126

127127
- **Identities**: Stored in `~/.config/icp/identity/` as PEM files (Secp256k1 or Ed25519)
128-
- **Canister IDs**: Persisted in `.icp/data/<network-name>/canister_ids.json` within project directories
128+
- **Canister IDs**: Persisted in `.icp/{cache,data}/mappings/<environment>.ids.json` within project directories
129+
- Managed networks (local) use `.icp/cache/mappings/`
130+
- Connected networks (mainnet) use `.icp/data/mappings/`
129131

130132
Store management is in `crates/icp/src/store_id.rs`.
131133

@@ -193,8 +195,18 @@ The project includes JSON schemas for manifest validation:
193195

194196
### Docs generation
195197

196-
- The cli reference is generated in `docs/cli-reference.md`.
197-
- Regenerate the cli reference when commands changes by running: `./scripts/generate-cli-docs.sh`
198+
- The CLI reference is generated in `docs/reference/cli.md`.
199+
- Regenerate the CLI reference when commands change by running: `./scripts/generate-cli-docs.sh`
200+
201+
### Documentation Structure
202+
203+
Documentation follows the Diátaxis framework:
204+
205+
- `docs/tutorial.md` — Learning-oriented first deployment guide
206+
- `docs/guides/` — Task-oriented how-to guides
207+
- `docs/concepts/` — Understanding-oriented explanations
208+
- `docs/reference/` — Information-oriented technical specifications
209+
- `docs/migration/` — Migration guides (e.g., from dfx)
198210

199211
### Paths
200212

README.md

Lines changed: 45 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -1,112 +1,78 @@
11
# icp-cli
22

3-
A command-line interface for developing and deploying applications on the Internet Computer Protocol (ICP).
3+
A command-line tool for building and deploying applications on the Internet Computer.
44

5-
## Usage
6-
7-
See the [command line reference](docs/cli-reference.md).
8-
9-
## Installing
10-
11-
For now, you have to build icp-cli locally in order to use it.
12-
13-
### Prerequisites
14-
15-
- **Rust**: Install Rust using [rustup](https://rustup.rs/). The project uses Rust 2024 edition.
16-
- **mops**: Required if you want to build Motoko canisters. See [mops.one](https://cli.mops.one/).
17-
18-
### Building
5+
## Quick Start
196

207
```bash
21-
# Build all crates in the workspace
22-
cargo build
8+
# Install via Homebrew (macOS)
9+
brew install dfinity/tap/icp-cli
2310

24-
# Add target directory to your path
25-
export PATH=$(pwd)/target/debug:$PATH
11+
# Create and deploy a project
12+
icp new my-project && cd my-project
13+
icp network start -d
14+
icp deploy
2615

27-
# Check that you can run
28-
icp help
16+
# List your canisters and call a method (canister name depends on your template)
17+
icp canister list
18+
icp canister call <canister-name> greet '("World")'
2919
```
3020

31-
### [Optional] Add motoko tools to the path
21+
See the [Installation Guide](docs/guides/installation.md) for all installation methods including building from source.
3222

33-
You might also need the Motoko compiler if you plan on building canisters with Motoko. The best way
34-
is to install mops, the motoko package manager, see: https://cli.mops.one/
23+
## For dfx Users
3524

36-
Reminder, when mops is installed the first time, you must initialize the toolchain with:
25+
If you're coming from dfx (the previous Internet Computer SDK), see the **[Migration Guide](docs/migration/from-dfx.md)** for command mappings, workflow differences, and how to migrate existing projects.
3726

38-
```bash
39-
mops toolchain init
40-
```
41-
42-
### Examples
27+
## Documentation
4328

44-
The `examples/` directory contains various project templates and configurations that demonstrate how to use the CLI with different project types:
29+
- **[Tutorial](docs/tutorial.md)** — Deploy your first canister
30+
- **[Guides](docs/guides/index.md)** — How to accomplish common tasks
31+
- **[Concepts](docs/concepts/index.md)** — Understand how icp-cli works
32+
- **[Reference](docs/reference/index.md)** — Complete CLI and configuration reference
4533

46-
- `icp-motoko/` - Motoko canister example
47-
- `icp-rust/` - Rust canister example
48-
- `icp-static-assets/` - Static website deployment
49-
- `icp-multi-canister/` - Multi-canister project setup
50-
- And many more...
34+
## Examples
5135

52-
## Development
36+
The [`examples/`](examples/) directory contains example projects to help you get started:
5337

54-
### Prerequisites
38+
- `icp-motoko/` — Motoko canister
39+
- `icp-rust/` — Rust canister
40+
- `icp-static-assets/` — Static website
41+
- `icp-environments/` — Multi-environment setup
5542

56-
- **Rust**: Install Rust using [rustup](https://rustup.rs/). The project uses Rust 2024 edition.
43+
[View all examples →](examples/)
5744

58-
### Building
45+
## Prerequisites
5946

60-
This is a Rust workspace with multiple crates. To build the project:
47+
**Language-specific toolchains** (install for the languages you'll use):
48+
- **Rust canisters**[Rust](https://rustup.rs/) and `rustup target add wasm32-unknown-unknown`
49+
- **Motoko canisters**[mops](https://cli.mops.one/) and `mops toolchain init`
6150

62-
```bash
63-
# Build all crates in the workspace
64-
cargo build
51+
## Getting Help
6552

66-
# Build in release mode for better performance
67-
cargo build --release
53+
- **[Documentation](docs/index.md)** — Guides, concepts, and reference
54+
- **[GitHub Issues](https://github.com/dfinity/icp-cli/issues)** — Bug reports and feature requests
55+
- **[Developer Forum](https://forum.dfinity.org/)** — Questions and discussions
56+
- **[Discord](https://discord.internetcomputer.org)** — Real-time community chat in #dx-feedback
6857

69-
# Build only the CLI binary
70-
cargo build --bin icp
71-
```
72-
73-
The compiled binary will be available at `target/debug/icp` (or `target/release/icp` for release builds).
58+
## Contributing
7459

75-
### Running Tests
60+
Contributions are welcome! See [CONTRIBUTING.md](.github/CONTRIBUTING.md) for guidelines.
7661

7762
```bash
78-
cargo test
79-
```
80-
81-
The network launcher binary is automatically downloaded on first test run. Some tests launch local networks and require available ports.
82-
83-
### Generating CLI Documentation
63+
# Build
64+
cargo build
8465

85-
The project includes automatic CLI documentation generation using `clap_markdown`. To generate comprehensive documentation for all commands:
66+
# Test
67+
cargo test
8668

87-
```bash
88-
# Run the documentation generation script
69+
# Generate CLI docs
8970
./scripts/generate-cli-docs.sh
90-
```
9171

92-
This will:
93-
- Build the CLI in release mode
94-
- Generate complete markdown documentation at `docs/cli-reference.md`
95-
96-
You can also generate documentation manually:
97-
98-
```bash
99-
# Build the CLI first
100-
cargo build --release
101-
102-
# Generate markdown documentation
103-
./target/release/icp --markdown-help > docs/cli-reference.md
72+
# Update the yaml file schemas
73+
./scripts/config-schemas.sh
10474
```
10575

106-
## Contributing
107-
108-
Contributions are welcome! Please see the [contribution guide](./.github/CONTRIBUTING.md) for more information.
109-
11076
## License
11177

112-
This project is licensed under the [Apache-2.0](./LICENSE) license.
78+
[Apache-2.0](LICENSE)

0 commit comments

Comments
 (0)