Skip to content
This repository was archived by the owner on Feb 6, 2026. It is now read-only.
This repository was archived by the owner on Feb 6, 2026. It is now read-only.

Add init command and config test for guided setup and connectivity verification #19

@rianjs

Description

@rianjs

Summary

Add an init command for guided setup and a config test command for connectivity verification, matching the patterns in confluence-cli and other open-cli-collective CLIs.

Current State

  • Has: config set, config show, config clear
  • Has: me command (implicitly tests auth by fetching current user)
  • Missing: guided init wizard, explicit config test

Commands to Add

1. jira-ticket-cli init

Interactive setup wizard (similar to cfl init):

$ jira-ticket-cli init
Jira CLI Setup

Domain (e.g., 'mycompany' for mycompany.atlassian.net): mycompany
Email: user@example.com
API Token: ****

Testing connection...
✓ Connected to mycompany.atlassian.net
✓ Authenticated as User Name (user@example.com)

Configuration saved to ~/.config/jira-ticket-cli/config.yml

Try it out:
  jira-ticket-cli issues list --project PROJ
  jira-ticket-cli me

Features:

  • Interactive prompts for domain, email, API token
  • Connectivity verification (unless --no-verify)
  • Existing config detection with overwrite prompt
  • Clear success message with example commands
  • Optional: --domain, --email, --token flags for non-interactive use

2. jira-ticket-cli config test

Explicit connectivity test (like slack-chat-api config test):

$ jira-ticket-cli config test
Testing connection to mycompany.atlassian.net...
✓ Authentication successful
✓ API access verified

Authenticated as: User Name (user@example.com)
Account ID: 123456:abcd-efgh-...

On failure:

$ jira-ticket-cli config test
Testing connection to mycompany.atlassian.net...
✗ Authentication failed: 401 Unauthorized

Check your credentials with: jira-ticket-cli config show
Reconfigure with: jira-ticket-cli init

Why both me and config test?

  • me returns user data (for scripting, output formats)
  • config test is explicitly for diagnostics (clear pass/fail, suggestions on failure)
  • Different UX purposes: config test is "does this work?" while me is "who am I?"

Implementation Notes

  • Can reuse api.GetCurrentUser() for connectivity verification
  • Consider using charmbracelet/huh for TUI prompts (like confluence-cli) or simple stdin prompts
  • init should call the same verification logic as config test

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions