mirror of
https://github.com/pocket-id/pocket-id.git
synced 2026-05-04 18:00:38 +03:00
[PR #1205] [CLOSED] feat: Add comprehensive CLI for all Pocket-ID APIs #1088
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/pocket-id/pocket-id/pull/1205
Author: @coffe-cafe-zed
Created: 1/6/2026
Status: ❌ Closed
Base:
main← Head:extend-cmds📝 Commits (2)
593d8d4feat: Add comprehensive CLI for all REST APIse586511add tests📊 Changes
30 files changed (+8456 additions, -2 deletions)
View changed files
➕
CLI_USAGE.md(+680 -0)📝
README.md(+85 -0)📝
backend/internal/bootstrap/bootstrap.go(+5 -0)➕
backend/internal/bootstrap/initial_admin.go(+120 -0)➕
backend/internal/cmds/api_client.go(+255 -0)➕
backend/internal/cmds/api_key.go(+376 -0)➕
backend/internal/cmds/app_config.go(+182 -0)➕
backend/internal/cmds/app_images.go(+170 -0)➕
backend/internal/cmds/custom_claims.go(+194 -0)➕
backend/internal/cmds/oidc_clients.go(+487 -0)📝
backend/internal/cmds/root.go(+23 -0)➕
backend/internal/cmds/scim.go(+233 -0)➕
backend/internal/cmds/setup.go(+124 -0)➕
backend/internal/cmds/user_groups.go(+398 -0)➕
backend/internal/cmds/users.go(+492 -0)📝
backend/internal/common/env_config.go(+5 -0)📝
backend/internal/common/env_config_test.go(+43 -0)📝
tests/playwright.config.ts(+2 -2)➕
tests/run-cli-tests.sh(+330 -0)➕
tests/specs/cli-api-keys.spec.ts(+329 -0)...and 10 more files
📄 Description
Description
This PR adds a comprehensive command-line interface (CLI) to Pocket-ID that makes all REST APIs available as commands following industry best practices. All existing API endpoints are now accessible via CLI commands.
Features
🚀 New Commands:
pocket-id setup create-admin- Create initial admin user for fresh installationspocket-id users- Complete user management (list, get, create, update, delete, me, update-me)pocket-id api-key- API key management with hybrid approach:generate- Direct database access (works without server)create/list/revoke- API-based (requires running server)pocket-id oidc-clients- OIDC client management (list, get, create, update, delete, create-secret, update-allowed-groups)pocket-id user-groups- User group management (list, get, create, update, delete, update-users, update-allowed-clients)pocket-id app-config- Application configuration (get, get-all, update, test-email, sync-ldap)pocket-id app-images- Application images (update, delete for logos, backgrounds, favicons, profile pictures)pocket-id custom-claims- Custom claims management (suggestions, update-user, update-user-group)pocket-id scim- SCIM service providers (create, update, delete, sync)🔧 Key Features:
Hybrid Architecture:
export,import,key-rotate,api-key generate)users *,api-key create/list/revoke,oidc-clients *,user-groups *,app-config *,app-images *,custom-claims *,scim *)Environment Variable Support:
POCKET_ID_API_KEYfor authenticationMultiple Output Formats:
Industry Standard:
📚 Documentation:
CLI_USAGE.mdwith examples and workflows--helpflagUsage Examples
Fresh Installation:
Existing Installation:
Technical Details
Architecture:
X-API-KEYheader support and multipart/form-data handlingMinimal Changes:
Testing:
exclude_frontendtagWhy This Approach?
Checklist
Screenshots
Command help output showing new commands:
This PR provides a comprehensive, production-ready CLI that makes all Pocket-ID APIs accessible via command-line interface. It follows industry best practices while maintaining backward compatibility and requiring minimal changes to the existing codebase. The CLI now provides complete coverage of the REST API surface area, enabling full administration and automation capabilities.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.