Skip to content

stash CLI: read commands dead-end when stash.config.ts is missing (no scaffold, no guidance) #578

Description

@coderdan

Problem

Running a read command such as eql status in a project without a stash.config.ts prints a hand-written-file instruction and cancels, but does not offer to scaffold the config or point at the commands that would:

$ npx stash eql status
┌  npx stash eql status
│
Error: Could not find stash.config.ts

Create a stash.config.ts file in your project root:

  import { defineConfig, resolveDatabaseUrl } from 'stash'

  export default defineConfig({
    databaseUrl: await resolveDatabaseUrl(),
  })

■  Canceled

The message is a dead end: it tells you to hand-write a file, but never mentions stash init (full setup) or stash eql install (which does scaffold a config for you).

Root cause

loadStashConfig() in packages/cli/src/config/index.ts (the missing-config branch, ~line 98) prints a static "create it yourself" message and process.exit(1). Unlike eql install, it does not call ensureStashConfig() nor reference the setup commands.

Suggested fix

Make the missing-config message actionable and runner-aware — recommend stash init / stash eql install before the hand-written fallback. (Keeping it non-interactive for read commands is fine; the key is pointing at the commands that set things up.)

Related

Sibling issue: standalone eql install scaffolds a config that then fails to load. A fix PR will address both.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions