|
| 1 | +--- |
| 2 | +name: foc-cli |
| 3 | +description: Use when working with Filecoin Onchain Cloud, foc-cli, Synapse SDK, storing files on Filecoin, PDP datasets, USDFC payments, wallets, deposits, uploads, providers, datasets, pieces, or decentralized cloud storage on Filecoin. |
| 4 | +--- |
| 5 | + |
| 6 | +# foc-cli — Filecoin Onchain Cloud CLI |
| 7 | + |
| 8 | +Use the upstream `foc-cli` as the source of truth for Filecoin Onchain Cloud operations. |
| 9 | + |
| 10 | +Source: https://github.com/FIL-Builders/foc-cli |
| 11 | + |
| 12 | +## Operating Principle |
| 13 | + |
| 14 | +This store skill is a lightweight catalog wrapper. Do not rely on hardcoded command details here. The upstream `FIL-Builders/foc-cli` repository and the published `foc-cli` package are the source of truth. |
| 15 | + |
| 16 | +## Upstream Skill Location and Sync |
| 17 | + |
| 18 | +If the host agent supports installing external skills, install the upstream skill from GitHub rather than copying its contents into this store skill: |
| 19 | + |
| 20 | +```bash |
| 21 | +npx --yes skills add FIL-Builders/foc-cli --skill foc-cli --yes |
| 22 | +npx --yes skills add FIL-Builders/foc-cli --skill foc-docs --yes |
| 23 | +``` |
| 24 | + |
| 25 | +Use `--global --yes` only when a user-level install is desired. Store the installed upstream skill in the agent's normal skills directory as managed by `skills.sh` / the host agent. Do not vendor a second copy inside project repositories unless the user explicitly asks. |
| 26 | + |
| 27 | +Refresh the upstream skill: |
| 28 | + |
| 29 | +- at the start of a new long-running FOC task, |
| 30 | +- whenever a command appears missing or behavior differs from this wrapper, |
| 31 | +- after upstream `FIL-Builders/foc-cli` releases or documentation changes, |
| 32 | +- at least weekly for active projects. |
| 33 | + |
| 34 | +Preferred refresh commands: |
| 35 | + |
| 36 | +```bash |
| 37 | +npx --yes skills update foc-cli --yes |
| 38 | +npx --yes skills update foc-docs --yes |
| 39 | +``` |
| 40 | + |
| 41 | +For user-level installs, add `--global`; for project-level installs, add `--project` if the host agent needs an explicit scope. |
| 42 | + |
| 43 | +## CLI Version and Update Cadence |
| 44 | + |
| 45 | +Prefer `npx --yes foc-cli ...` so commands resolve through the current published package instead of a stale global install. |
| 46 | + |
| 47 | +For active FOC work, check the CLI interface at the start of each session. If using a global install, update it at least weekly and whenever command help/schema disagrees with docs: |
| 48 | + |
| 49 | +```bash |
| 50 | +npm install -g foc-cli@latest |
| 51 | +foc-cli --help |
| 52 | +``` |
| 53 | + |
| 54 | +## Discovery First |
| 55 | + |
| 56 | +Always inspect help or schema before running an operational command: |
| 57 | + |
| 58 | +```bash |
| 59 | +npx --yes foc-cli --help |
| 60 | +npx --yes foc-cli <command> -h |
| 61 | +npx --yes foc-cli <command> --schema |
| 62 | +``` |
| 63 | + |
| 64 | +Prefer structured output when an agent needs to parse results: |
| 65 | + |
| 66 | +```bash |
| 67 | +npx --yes foc-cli <command> --json |
| 68 | +``` |
| 69 | + |
| 70 | +## Common Starting Points |
| 71 | + |
| 72 | +```bash |
| 73 | +npx --yes foc-cli wallet init --auto |
| 74 | +npx --yes foc-cli wallet balance --json |
| 75 | +npx --yes foc-cli wallet fund |
| 76 | +npx --yes foc-cli wallet deposit <amount> |
| 77 | +npx --yes foc-cli upload <path> |
| 78 | +npx --yes foc-cli dataset list --json |
| 79 | +npx --yes foc-cli provider list --json |
| 80 | +``` |
| 81 | + |
| 82 | +## Documentation |
| 83 | + |
| 84 | +For current Filecoin Onchain Cloud docs, use the companion `foc-docs` skill or query the CLI docs command: |
| 85 | + |
| 86 | +```bash |
| 87 | +npx --yes foc-cli docs --prompt "upload files" |
| 88 | +npx --yes foc-cli docs --prompt "payments" |
| 89 | +npx --yes foc-cli docs --prompt "PDP" |
| 90 | +``` |
| 91 | + |
| 92 | +## Safety |
| 93 | + |
| 94 | +Wallet, deposit, withdrawal, upload, dataset termination, and mainnet actions can affect funds or persisted data. Explain the intended action and get explicit user confirmation before executing state-changing commands, especially with `--chain 314` mainnet. |
0 commit comments