Instalacja
Wymagania wstępne
- Node.js 20.19.0 lub nowsza — Sprawdź swoją wersję:
node --version
Instalacja z pomocą asystenta AI
Wolisz nie robić tego ręcznie? Wklej poniższy prompt do dowolnego asystenta programistycznego, który potrafi uruchamiać polecenia powłoki — Claude Code, Codex, Cursor, Gemini CLI, Copilot i pozostałe wspierane narzędzia. Zainstaluje on CLI, zainicjalizuje ten projekt i poinformuje, co faktycznie się wydarzyło.
Poniższe ręczne kroki są źródłem prawdy — prompt po prostu wykonuje je za Ciebie. Jeśli asystent zatrzyma się i coś zwróci, jest to celowe: prosi o zgodę przed wykonaniem czegokolwiek uprzywilejowanego i nigdy nie edytuje plików startowych Twojej powłoki. Te części dokończ samodzielnie, korzystając z Menedżerów pakietów i Rozwiązywania problemów.
Install OpenSpec in this project and set it up for me. Follow these steps in
order, and stop where a step tells you to stop.
1. RUNTIME. Run `node --version`. OpenSpec needs Node.js 20.19.0 or higher. If
Node is missing or older, say so and stop — don't install Node, switch
versions, or reconfigure my version manager for me.
2. INSTALL. Use whichever package manager is already on my PATH, preferring npm:
npm install -g @fission-ai/openspec@latest
pnpm add -g @fission-ai/openspec@latest
bun add -g @fission-ai/openspec@latest
yarn global add @fission-ai/openspec@latest (Yarn 1.x only)
Don't pick based on this project's lockfile — a global install has nothing to
do with how this repo's own dependencies are installed. If none of those four
is available, stop and tell me — don't improvise an install. (If I'm on Nix,
point me at the Nix section of the OpenSpec installation docs instead.)
Show me the exact command and let me confirm before you run it; this installs
software outside the project, and I may want a different package manager to
own it.
Stop and ask me again if the install needs sudo or admin rights, fails with a
permissions error, or reports that its global bin directory is missing or
unconfigured. Never edit my shell startup files (.bashrc, .zshrc, .profile,
fish, PowerShell profile), and never run a setup command that edits them for
me — show me the change and let me make it.
3. PATH. Run `openspec --version`. If the command isn't found, it may just be
missing from this shell: tell me where the package manager installed it and
how to add that directory to PATH for my shell and OS, then stop until I
confirm. If it prints an older version than the one the install just
reported, an earlier copy is shadowing it on PATH — tell me both versions
instead of continuing. If I use a version manager, say so rather than editing
PATH around it: with nvm or fnm the CLI is tied to the Node version that was
active when you installed it, and with asdf or volta a shim may need
regenerating.
4. INITIALIZE. Ask me which AI coding tool or tools I use and map each to an id
from `openspec init --help` (Copilot is `github-copilot`, Zoo Code is
`roocode`). `--tools` takes a comma-separated list, so name all of them.
`openspec init --tools <ids>` deletes leftovers from older OpenSpec versions
automatically, without asking — including `opsx-*.md` prompt files in my home
directory (Codex keeps them in ~/.codex/prompts). Before you run it, look for
those: `.../commands/openspec/` folders, OpenSpec marker blocks in files like
CLAUDE.md or AGENTS.md, and home-directory `opsx-*.md` prompts. List whatever
you find and wait for my go-ahead; if you find nothing, say so and carry on
without asking. An existing `openspec/` folder is not a problem — init
refreshes it and leaves my specs and changes alone.
Confirm I'm in the right folder too: init creates `openspec/` wherever it
runs, including inside a monorepo package.
Then run: openspec init --tools <ids>
5. REPORT. Don't assume what should exist — tell me what init actually printed:
how many skills and/or commands it created and where, the config file line,
any "Setup required" note, and what to restart or reload. Some tools are
skills-only and correctly create zero command files, so missing commands is
not a failure on its own. If init said nothing was generated, relay the fix
it suggested instead of retrying. Finish by telling me how to invoke OpenSpec
in my tool, and take the exact spelling from the files init created rather
than from its summary line: the punctuation differs per tool (/opsx:propose
in some, /opsx-propose in others, @opsx-propose in Amazon Q), and tools that
get skills instead of commands are invoked by skill name (/openspec-propose,
or $openspec-propose in Codex, or /skill:openspec-propose in Kimi Code).W tym prompcie nie ma nic specyficznego dla danego producenta: to zwykłe instrukcje plus te same polecenia, które są udokumentowane na tej stronie. Działa on na systemach macOS, Linux i Windows i celowo zatrzymuje się, zamiast improwizować, gdy krok wymaga Twojej zgody. Twój asystent musi jednak mieć możliwość uruchamiania poleceń powłoki — kilka integracji z IDE tego nie potrafi.
Menedżery pakietów
npm
npm install -g @fission-ai/openspec@latestpnpm
pnpm add -g @fission-ai/openspec@latestyarn
yarn global add @fission-ai/openspec@latestYarn 2 i nowsze (Berry) usunęły polecenie global. W tych wersjach zainstaluj OpenSpec przy użyciu npm, pnpm lub bun — globalne CLI nie musi dzielić menedżera pakietów z Twoim projektem.
deno
Deno czasami ma problemy z parsowaniem znacznika @latest, ale możemy podczas początkowej instalacji podać konkretną wersję. Jeśli tak się stanie, możesz spróbować zamienić znacznik @latest na wersję, np. @^1.3.1
deno install --global \
--allow-read --allow-write --allow-env --allow-sys=cpus,homedir --allow-net=edge.openspec.dev \
npm:@fission-ai/openspec@latest
# lub
deno install --global \
--allow-read --allow-write --allow-env --allow-sys=cpus,homedir --allow-net=edge.openspec.dev \
npm:@fission-ai/openspec@^1.3.1bun
Bun potrafi zainstalować OpenSpec globalnie, ale OpenSpec obecnie działa na Node.js. Nadal potrzebujesz Node.js 20.19.0 lub nowszego dostępnego w PATH.
bun add -g @fission-ai/openspec@latestUwaga: Jeśli Twoje podkomendy uruchamiają zewnętrzne narzędzia, takie jak edycja konfiguracji, przesyłanie opinii czy otwieranie przestrzeni roboczej, możesz potrzebować ograniczonego zakresem flagi --allow-run=<program>.
Nix
Uruchom OpenSpec bezpośrednio bez instalacji:
nix run github:Fission-AI/OpenSpec -- initLub zainstaluj w swoim profilu:
nix profile install github:Fission-AI/OpenSpecAlbo dodaj do środowiska deweloperskiego w flake.nix:
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
openspec.url = "github:Fission-AI/OpenSpec";
};
outputs = { nixpkgs, openspec, ... }: {
devShells.x86_64-linux.default = nixpkgs.legacyPackages.x86_64-linux.mkShell {
buildInputs = [ openspec.packages.x86_64-linux.default ];
};
};
}Weryfikacja instalacji
openspec --versionAktualizacja
Zaktualizuj pakiet, a następnie odśwież wygenerowane pliki w każdym projekcie:
npm install -g @fission-ai/openspec@latest # lub odpowiednik pnpm/yarn/bun
openspec update # uruchom wewnątrz każdego projektuopenspec update regeneruje pliki umiejętności i poleceń dla skonfigurowanych przez Ciebie narzędzi, dzięki czemu Twoje slash commands są zawsze zgodne z zainstalowaną wersją. Sprawdza również, czy opublikowano nowszą wersję CLI i proponuje jej aktualizację, ponieważ aktualizacja to właśnie to, co sprawia, że nowe przepływy pracy stają się dostępne — zobacz CLI Reference.
Odinstalowanie
Nie ma polecenia openspec uninstall, ponieważ OpenSpec to po prostu globalny pakiet i kilka plików w Twoim projekcie. Usunięcie go to kilka ręcznych kroków, a nic tutaj nie dotyka Twojego kodu źródłowego.
1. Usuń pakiet globalny:
npm uninstall -g @fission-ai/openspec # lub: pnpm rm -g / yarn global remove / bun rm -g2. Usuń OpenSpec z projektu (opcjonalnie). Usuń katalog openspec/, jeśli nie potrzebujesz już jego specyfikacji i zmian:
rm -rf openspec/Zastanów się, zanim to zrobisz: openspec/specs/ i openspec/changes/archive/ to Twój zapis tego, jak system działa i dlaczego się zmienił. Jeśli ta historia może Ci się przydać, zachowaj folder (lub zachowaj go w git) nawet po odinstalowaniu.
3. Usuń wygenerowane pliki dla narzędzi AI (opcjonalnie). OpenSpec zapisuje pliki umiejętności i poleceń w katalogach poszczególnych narzędzi, takich jak .claude/skills/openspec-*/, .cursor/commands/opsx-* itd. Usuń umiejętności openspec-* i polecenia opsx-* dla wszystkich narzędzi, które skonfigurowałeś. Dokładne ścieżki dla każdego narzędzia znajdują się w Supported Tools.
Jeśli masz również bloki znaczników OpenSpec w plikach takich jak CLAUDE.md lub AGENTS.md, usuń je ręcznie; Twoja własna treść w tych plikach pozostaje nienaruszona.
Następne kroki
Po instalacji zainicjalizuj OpenSpec w swoim projekcie:
cd your-project
openspec initPełny przewodnik znajdziesz w Getting Started.