-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Task 0.1.4: CLI Context Management (attach, detach)
Title: Implement dataset context attachment for CLI sessions
Description:
The CLI should maintain a "current context" (attached dataset) that persists across commands within a session. This enables workflows like: attach to orders table → ask questions → see lineage → export results.
Why: Without context, every command requires repeating dataset identifiers. Context management makes the CLI feel like a proper development environment.
Acceptance Criteria:
-
dataing ds attach <dataset_id>sets current context -
dataing ds attach <urn>resolves URN to dataset -
dataing ds attach --sql "SELECT..." --datasource <id>attaches from SQL -
dataing ds detachclears context -
dataing ds currentshows current context with details - Context persists in
~/.dataing/context.json - All investigation commands use current context if no explicit target
- Context includes: dataset_id, datasource_id, URN, schema snapshot
-
--no-contextflag on any command ignores saved context
Key Design Notes:
- Context file is JSON with schema version for forward compatibility
- URN resolution uses
GET /api/v1/asset-instances/search - SQL attachment creates virtual context with inferred schema
Key APIs:
GET /api/v1/asset-instances/search(exists)GET /api/v1/datasources/{id}/schema(exists)
Dependencies:
- None (can be built independently)
Risks + Mitigations:
- Risk: Stale context after schema changes → Mitigation: Warn if schema changed since attachment
Effort: S (2-3 days)
Designation: OSS
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels