|
1 | 1 | # icp-cli |
2 | 2 |
|
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. |
4 | 4 |
|
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 |
19 | 6 |
|
20 | 7 | ```bash |
21 | | -# Build all crates in the workspace |
22 | | -cargo build |
| 8 | +# Install via Homebrew (macOS) |
| 9 | +brew install dfinity/tap/icp-cli |
23 | 10 |
|
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 |
26 | 15 |
|
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")' |
29 | 19 | ``` |
30 | 20 |
|
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. |
32 | 22 |
|
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 |
35 | 24 |
|
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. |
37 | 26 |
|
38 | | -```bash |
39 | | -mops toolchain init |
40 | | -``` |
41 | | - |
42 | | -### Examples |
| 27 | +## Documentation |
43 | 28 |
|
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 |
45 | 33 |
|
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 |
51 | 35 |
|
52 | | -## Development |
| 36 | +The [`examples/`](examples/) directory contains example projects to help you get started: |
53 | 37 |
|
54 | | -### Prerequisites |
| 38 | +- `icp-motoko/` — Motoko canister |
| 39 | +- `icp-rust/` — Rust canister |
| 40 | +- `icp-static-assets/` — Static website |
| 41 | +- `icp-environments/` — Multi-environment setup |
55 | 42 |
|
56 | | -- **Rust**: Install Rust using [rustup](https://rustup.rs/). The project uses Rust 2024 edition. |
| 43 | +[View all examples →](examples/) |
57 | 44 |
|
58 | | -### Building |
| 45 | +## Prerequisites |
59 | 46 |
|
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` |
61 | 50 |
|
62 | | -```bash |
63 | | -# Build all crates in the workspace |
64 | | -cargo build |
| 51 | +## Getting Help |
65 | 52 |
|
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 |
68 | 57 |
|
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 |
74 | 59 |
|
75 | | -### Running Tests |
| 60 | +Contributions are welcome! See [CONTRIBUTING.md](.github/CONTRIBUTING.md) for guidelines. |
76 | 61 |
|
77 | 62 | ```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 |
84 | 65 |
|
85 | | -The project includes automatic CLI documentation generation using `clap_markdown`. To generate comprehensive documentation for all commands: |
| 66 | +# Test |
| 67 | +cargo test |
86 | 68 |
|
87 | | -```bash |
88 | | -# Run the documentation generation script |
| 69 | +# Generate CLI docs |
89 | 70 | ./scripts/generate-cli-docs.sh |
90 | | -``` |
91 | 71 |
|
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 |
104 | 74 | ``` |
105 | 75 |
|
106 | | -## Contributing |
107 | | - |
108 | | -Contributions are welcome! Please see the [contribution guide](./.github/CONTRIBUTING.md) for more information. |
109 | | - |
110 | 76 | ## License |
111 | 77 |
|
112 | | -This project is licensed under the [Apache-2.0](./LICENSE) license. |
| 78 | +[Apache-2.0](LICENSE) |
0 commit comments