Skip to content

Conversation

@artpar
Copy link
Contributor

@artpar artpar commented Feb 6, 2026

Summary

This PR completely rewrites the daptin-cli from Go to TypeScript, modernizing the codebase and improving the developer experience. The new implementation uses Commander.js for CLI parsing, Axios for HTTP requests, and provides a more comprehensive set of commands with better output formatting.

Key Changes

  • Language Migration: Converted from Go to TypeScript/Node.js

    • Removed Go-specific files (Makefile, main.go, go.mod dependencies)
    • Added npm-based build system with tsup and TypeScript
  • New Client Library: Implemented a TypeScript Daptin client (src/client/)

    • Supports JSON:API protocol with proper request/response handling
    • Includes CRUD operations, actions, aggregations, and relations
    • Built-in axios interceptors for auth token management and debug logging
  • Expanded Command Set: Organized commands into logical modules

    • Auth: signup, signin, signin-2fa, whoami
    • Config: add, use, list, remove, show (multi-context support)
    • Schema: tables, describe
    • CRUD: list, get, create, update, delete
    • Actions: actions, action-describe, execute
    • Aggregation: aggregate with grouping, filtering, sorting
    • Relations: relation queries
  • Configuration Management:

    • YAML-based config stored in ~/.daptin/config.yaml
    • Support for multiple named server contexts
    • Token persistence per context
  • Output Formatting:

    • Table renderer (default) using cli-table3
    • JSON renderer for piping to tools like jq
    • Configurable via --output flag
  • Developer Experience:

    • TypeScript for type safety
    • Comprehensive README with examples
    • .gitignore for Node.js projects
    • npm scripts for build, dev, typecheck

Implementation Details

  • Uses Commander.js for CLI argument parsing with global options (--endpoint, --config, --output, --token, --debug)
  • Axios HTTP client with automatic Bearer token injection
  • Inquirer.js for interactive prompts (passwords, OTP)
  • Chalk for colored terminal output
  • Modular command registration pattern for easy extensibility
  • Error handling with user-friendly messages
  • Support for environment variables (DAPTIN_ENDPOINT, DAPTIN_CLI_CONFIG)

Breaking Changes

This is a complete rewrite, so the CLI interface has changed. Users will need to reinstall and reconfigure their server endpoints using the new config commands.

https://claude.ai/code/session_01KccsLPTwyJ4hkRmTQ2UU8G

Replace the Go CLI with a TypeScript implementation that provides a
Node.js-compatible client inspired by daptin-js-client. The new CLI
covers all original functionality plus new commands:

- Config management (add/use/list/remove/show server contexts)
- Authentication (signup, signin, signin-2fa, whoami with JWT decode)
- Schema discovery (tables list, describe with columns/relations/actions)
- Full CRUD (list with pagination/filter/sort, get, create, update, delete)
- Relationship queries
- Action management (list, describe schema, execute entity/instance actions)
- Aggregation queries (count, sum, avg, min, max with group/filter/having)
- Multiple output formats (table, JSON)

https://claude.ai/code/session_01KccsLPTwyJ4hkRmTQ2UU8G
@artpar artpar merged commit b9b1a60 into master Feb 7, 2026
0 of 7 checks passed
artpar pushed a commit that referenced this pull request Feb 7, 2026
…mVurH"

This reverts commit b9b1a60, reversing
changes made to a6b22ab.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants