Skip to content

feat: add Atlas provider#1

Open
ThiagoSantosOFC wants to merge 9 commits into
masterfrom
feat/atlas-provider
Open

feat: add Atlas provider#1
ThiagoSantosOFC wants to merge 9 commits into
masterfrom
feat/atlas-provider

Conversation

@ThiagoSantosOFC
Copy link
Copy Markdown
Contributor

Summary

  • Adds AtlasProvider class implementing the TaskProvider interface, enabling the tm CLI to manage Atlas tickets
  • Authentication is credential-based (email + password → JWT), with lazy auth on first request and transparent 401 retry
  • Config stored under the atlas key in ~/.config/task-manager/config.json; env vars ATLAS_API_URL, ATLAS_EMAIL, ATLAS_PASSWORD, ATLAS_DEFAULT_PROJECT_ID also supported

Changes

  • src/providers/atlas.ts (new) — Full AtlasProvider: axios client with interceptors, bidirectional status/priority enum mapping, all CRUD operations for tickets and projects
  • src/config.ts — Added atlas block to TaskManagerConfig interface; added ATLAS_* env-var handling in getEffectiveConfig()
  • src/index.ts — Imported AtlasProvider, wired it into getProvider(), added --email/--password options to config command, added Atlas display in --show
  • .env.example / README.md — Documented Atlas setup and env vars

How to use

tm config --provider atlas --url http://localhost:3000 --email user@example.com --password yourpassword
tm config --project <atlas-project-uuid>
tm list
tm add "New ticket"
tm done <uuid>

Verification

  • bun run typecheck → 0 errors
  • bun run build → exits 0
  • tm config --help shows --email and --password
  • tm config --show displays Atlas URL, email, and masked password (********)

Copilot AI review requested due to automatic review settings March 17, 2026 10:58
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new AtlasProvider implementation so the tm CLI can manage Atlas tickets/projects, including credential-based auth and configuration via config file or env vars.

Changes:

  • Added AtlasProvider with Axios client, auth interceptors, and ticket/project CRUD.
  • Extended config model + env var resolution to support an atlas provider.
  • Updated CLI wiring (getProvider(), tm config options, --show output) and documented Atlas usage/env vars.

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/providers/atlas.ts New provider implementation for Atlas tickets/projects, including auth + field mappings.
src/config.ts Adds atlas config block and resolves ATLAS_* env vars in getEffectiveConfig().
src/index.ts Wires Atlas provider into CLI, adds config flags, and displays Atlas config in --show.
bun.lock Updates Bun lockfile metadata.
README.md Documents Atlas provider setup and usage.
.env.example Adds ATLAS_* environment variable examples.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/config.ts
Comment on lines 58 to 69
// Check if we have env vars for vikunja
if (process.env.VIKUNJA_API_URL && process.env.VIKUNJA_TOKEN) {
return {
provider: process.env.TM_PROVIDER || 'vikunja',
provider: process.env.TM_PROVIDER || "vikunja",
vikunja: {
apiUrl: process.env.VIKUNJA_API_URL,
token: process.env.VIKUNJA_TOKEN,
defaultProjectId: process.env.VIKUNJA_DEFAULT_PROJECT_ID
? Number(process.env.VIKUNJA_DEFAULT_PROJECT_ID)
: fileConfig?.vikunja?.defaultProjectId,
},
};
Comment thread src/index.ts
}
if (options.url) newConfig.atlas.apiUrl = options.url;
if (options.email) newConfig.atlas.email = options.email;
if (options.password) newConfig.atlas.password = options.password;
Comment thread src/providers/atlas.ts
Comment on lines +266 to +275
try {
const response = await this.client.get<{ project: AtlasProject }>(
`/api/v1/projects/${id}`,
);
const p = (response.data as any).project ?? response.data;
return {
id: p.id,
name: p.name,
description: p.description ?? undefined,
};
Comment thread src/providers/atlas.ts
if (input.priority !== undefined)
payload.priority = taskPriorityToAtlas(input.priority);
if (input.dueDate !== undefined)
payload.dueDate = input.dueDate?.toISOString() ?? null;
Comment thread README.md
Comment on lines +28 to +38
```bash
# Configure Atlas
tm config --provider atlas --url http://localhost:3000 --email user@example.com --password yourpassword
tm config --project <atlas-project-uuid> # Set default project

# Use it
tm projects # List Atlas projects
tm list # List tickets (todo status)
tm list --all # All tickets
tm add "New ticket" # Create ticket
tm done <ticket-uuid> # Mark as done
Thiago Santos added 3 commits March 17, 2026 11:03
- listTasks: API returns { data: [] } not { tickets: [] }
- getProject: API returns the project object directly, not wrapped in { project: ... }
- Remove as-any cast now that the shape is properly typed
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