स्थापना
पूर्व-आवश्यकताएं
- Node.js 20.19.0 या उच्चतर — अपनी जांच करें:
node --version
अपने AI सहायक के साथ इंस्टॉल करें
इसे हाथ से करने में मन नहीं है? नीचे दिए गए प्रॉम्प्ट को किसी भी कोडिंग सहायक में पेस्ट करें जो शेल कमांड चला सकता हो — Claude Code, Codex, Cursor, Gemini CLI, Copilot, और समर्थित टूल्स की बाकी सूची। यह CLI को इंस्टॉल करता है, इस प्रोजेक्ट को इनिशियलाइज़ करता है, और बताता है कि वास्तव में क्या हुआ।
नीचे दिए गए मैन्युअल चरण सत्य का स्रोत हैं — प्रॉम्प्ट बस उन्हें आपके लिए चलाता है। यदि आपका सहायक रुक जाता है और कुछ वापस देता है, तो यह डिज़ाइन के अनुसार है: यह किसी भी विशेषाधिकार वाली क्रिया से पहले पूछता है और कभी भी आपके शेल स्टार्टअप फ़ाइलों को एडिट नहीं करता है। उन हिस्सों को स्वयं पैकेज मैनेजर और ट्रबलशूटिंग के साथ पूरा करें।
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).प्रॉम्प्ट में कोई भी चीज़ वेंडर-विशिष्ट नहीं है: यह साधारण निर्देश हैं और उसी कमांड्स का उपयोग करते हैं जो इस पृष्ठ पर दस्तावेज़ीकृत हैं। यह macOS, Linux, और Windows पर काम करता है, और यह जानबूझकर रुक जाता है जब किसी चरण के लिए आपकी अनुमति की आवश्यकता होती है। आपके सहायक को शेल कमांड चलाने में सक्षम होना चाहिए — कुछ IDE इंटीग्रेशन ऐसा नहीं कर सकते।
पैकेज मैनेजर
npm
npm install -g @fission-ai/openspec@latestpnpm
pnpm add -g @fission-ai/openspec@latestyarn
yarn global add @fission-ai/openspec@latestYarn 2 और बाद के संस्करण (Berry) ने global कमांड हटा दिया है। उन संस्करणों पर, npm, pnpm, या bun के साथ OpenSpec इंस्टॉल करें — एक ग्लोबल CLI को आपके प्रोजेक्ट के पैकेज मैनेजर को शेयर करने की आवश्यकता नहीं है।
deno
Deno कभी-कभी @latest टैग को पार्स करने में समस्याओं का सामना करता है, लेकिन हम शुरू में इंस्टॉल करते समय एक संस्करण निर्दिष्ट कर सकते हैं। यदि ऐसा होता है, तो आप @^1.3.1 जैसे संस्करण के साथ @latest टैग को बदलने का प्रयास कर सकते हैं।
deno install --global \
--allow-read --allow-write --allow-env --allow-sys=cpus,homedir --allow-net=edge.openspec.dev \
npm:@fission-ai/openspec@latest
# or
deno install --global \
--allow-read --allow-write --allow-env --allow-sys=cpus,homedir --allow-net=edge.openspec.dev \
npm:@fission-ai/openspec@^1.3.1नोट: यदि आपके सबकमांड बाहरी टूल्स को लॉन्च करते हैं, जैसे कॉन्फ़िगरेशन एडिट, फीडबैक, या वर्कस्पेस ओपन, तो आपको एक स्कोप्ड --allow-run=<program> की आवश्यकता हो सकती है।
bun
Bun OpenSpec को ग्लोबली इंस्टॉल कर सकता है, लेकिन OpenSpec वर्तमान में Node.js पर चलता है। आपको PATH पर Node.js 20.19.0 या उच्चतर उपलब्ध रखने की अभी भी आवश्यकता है।
bun add -g @fission-ai/openspec@latestNix
इंस्टॉलेशन के बिना OpenSpec को सीधे चलाएँ:
nix run github:Fission-AI/OpenSpec -- initया अपने प्रोफ़ाइल में इंस्टॉल करें:
nix profile install github:Fission-AI/OpenSpecया 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 ];
};
};
}स्थापना की पुष्टि करें
openspec --versionअपडेट करना
पैकेज को अपग्रेड करें, फिर प्रत्येक प्रोजेक्ट के जनरेटेड फ़ाइलों को रीफ़्रेश करें:
npm install -g @fission-ai/openspec@latest # or pnpm/yarn/bun equivalent
openspec update # run inside each projectopenspec update आपके द्वारा कॉन्फ़िगर किए गए टूल्स के लिए स्किल और कमांड फ़ाइलों को पुनः उत्पन्न करता है, ताकि आपके स्लैश कमांड इंस्टॉल किए गए संस्करण के साथ समकालिक रहें। यह यह भी जाँचता है कि क्या कोई नया CLI प्रकाशित किया गया है और अपग्रेड करने का प्रस्ताव देता है, क्योंकि अपग्रेड ही वह है जो नई वर्कफ़्लो को उपलब्ध कराता है — CLI रेफ़रेंस देखें।
अनइंस्टॉल करना
openspec uninstall नाम का कोई कमांड नहीं है, क्योंकि OpenSpec केवल एक ग्लोबल पैकेज और आपके प्रोजेक्ट में कुछ फ़ाइलें है। इसे हटाना कुछ मैन्युअल चरणों में होता है, और यहाँ की गई कोई भी चीज़ आपके सोर्स कोड को प्रभावित नहीं करती है।
1. ग्लोबल पैकेज हटाएँ:
npm uninstall -g @fission-ai/openspec # or: pnpm rm -g / yarn global remove / bun rm -g2. प्रोजेक्ट से OpenSpec हटाएँ (वैकल्पिक)। यदि आप अब इसके स्पेक्स और चेंजेस नहीं चाहते, तो openspec/ डायरेक्टरी हटा दें:
rm -rf openspec/इसे करने से पहले सोचें: openspec/specs/ और openspec/changes/archive/ आपके सिस्टम के व्यवहार और उसके बदलाव के कारण का रिकॉर्ड हैं। यदि आपको भविष्य में उस इतिहास की आवश्यकता हो सकती है, तो अनइंस्टॉल करने के बाद भी फ़ोल्डर को बनाए रखें (या उसे git में रखें)।
3. जनरेटेड AI टूल फ़ाइलें हटाएँ (वैकल्पिक)। OpenSpec .claude/skills/openspec-*/, .cursor/commands/opsx-* आदि जैसे प्रति-टूल डायरेक्टरी में स्किल और कमांड फ़ाइलें लिखता है। जिन टूल्स को आपने कॉन्फ़िगर किया है, उनके लिए openspec-* स्किल्स और opsx-* कमांड्स हटा दें। प्रति टूल सटीक पथ समर्थित टूल्स में सूचीबद्ध हैं।
यदि आपके पास CLAUDE.md या AGENTS.md जैसी फ़ाइलों में OpenSpec मार्कर ब्लॉक भी हैं, तो उन ब्लॉकों को मैन्युअल रूप से हटा दें; उन फ़ाइलों में आपका अपना सामग्री आपकी रखने के लिए है।
अगले कदम
इंस्टॉल करने के बाद, अपने प्रोजेक्ट में OpenSpec को इनिशियलाइज़ करें:
cd your-project
openspec initपूर्ण गाइड के लिए शुरुआत देखें।