Fission-AI/OpenSpec · error · Error
No OpenSpec planning home found from the current directory.
Error message
No OpenSpec planning home found from the current directory.
What it means
Thrown by resolveCurrentPlanningHomeSync when no OpenSpec planning root can be found by walking up from the search start directory, and implicit repo-root fallback is explicitly disabled via allowImplicitRepoRoot === false. It is a sentinel guard: the directory tree simply contains no planning home.
Solutions
- Run from a directory inside an OpenSpec-initialized repository, or run 'openspec init' to create one
- Pass an explicit startPath pointing at a known OpenSpec root
- Allow implicit repo-root resolution by not setting allowImplicitRepoRoot to false
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at src/core/planning-home.ts:86 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of Fission-AI/OpenSpec@6926ccb18a (2026-08-25).
Data as JSON: /api/errors/77f771516d5235f2.
Report an issue: GitHub.
Appendix: source
Thrown at src/core/planning-home.ts:86
root: repoRoot,
changesDir: path.join(repoRoot, 'openspec', 'changes'),
defaultSchema: REPO_DEFAULT_SCHEMA,
};
}
export function resolveCurrentPlanningHomeSync(
options: ResolvePlanningHomeOptions = {}
): PlanningHome {
const startPath = options.startPath ?? process.cwd();
const searchStart = getSearchStartDirectory(startPath);
const repoRoot = findRepoPlanningRootSync(searchStart);
if (repoRoot) {
return repoPlanningHome(repoRoot);
}
if (options.allowImplicitRepoRoot === false) {
throw new Error('No OpenSpec planning home found from the current directory.');
}
return repoPlanningHome(FileSystemUtils.canonicalizeExistingPath(searchStart));
}
export function getChangeDir(planningHome: PlanningHome, changeName: string): string {
return FileSystemUtils.joinPath(planningHome.changesDir, changeName);
}
export function formatChangeLocation(planningHome: PlanningHome, changeName: string): string {
// Repo homes always nest changesDir under the root.
return path.relative(planningHome.root, getChangeDir(planningHome, changeName));
}
View on GitHub (pinned to 6926ccb18a)