feat(cli): user-scoped public API — checkin, form, kudos, user commands#18
Merged
Conversation
Add HTTP client methods for check-in completion, forms, users, and kudos so logged-in users can call the public API endpoints from the CLI. Co-authored-by: Cursor <cursoragent@cursor.com>
Introduce user-scoped subcommands with shared auth helpers, confirmation for writes, JSON output, and display helpers wired into the CLI entry point. Co-authored-by: Cursor <cursoragent@cursor.com>
Exercise auth resolution, JSON output, confirmations, and API error paths with mocked HTTP so the new public API commands stay regression-safe. Co-authored-by: Cursor <cursoragent@cursor.com>
Route credentials and config file paths through get_config_dir() so clitest sandboxes do not read or overwrite the user's production ~/.config/dailybot/. Co-authored-by: Cursor <cursoragent@cursor.com>
Add clitest-local, persistent API URL selection, isolated config dir per venv, and attach the CLI devcontainer to the Dailybot project network. Co-authored-by: Cursor <cursoragent@cursor.com>
Pick the organization before the OTP prompt, drop misleading --org hints in interactive mode, and fall back to a numbered list when questionary fails. Co-authored-by: Cursor <cursoragent@cursor.com>
Surface the active API endpoint on startup, re-prompt when credentials target a different API, and avoid crashing the menu when login exits with an error. Co-authored-by: Cursor <cursoragent@cursor.com>
Move check-in, form, and user list logic into reusable handlers with pick_from_list helper so headless commands and interactive mode share flows. Co-authored-by: Cursor <cursoragent@cursor.com>
Add user list command, kudos teammate picker, forms/members menu items, and merge pending check-ins into a fill-in flow that prompts for answers. Co-authored-by: Cursor <cursoragent@cursor.com>
Add tests for dailybot user list and the interactive give-kudos flow with mocked teammate selection and confirmation. Co-authored-by: Cursor <cursoragent@cursor.com>
… API ## Summary - Add _MAX_LIST_PAGES cap (50) to list_users() to prevent unbounded pagination loops - Add pagination cap test (test_list_users_page_cap) to api_client_test.py - Fix B021 f-string-as-docstring linter errors in checkin, form, kudos, user commands - Fix UP032/I001 ruff import ordering issues (kudos.py, api_client.py) - Fix no-redef mypy error in collect_checkin_answers (answers → collected) - Fix infinite loop in TestInteractiveLogin test: mock returned old "Quit" value instead of the new "exit" action ID after menu refactor - Remove unused EXIT_USER_ABORTED import from user_scoped_actions.py ## Risks - None; all 170 tests pass, ruff clean, mypy clean Co-authored-by: Cursor <cursoragent@cursor.com>
## Summary Add full documentation for the new user-scoped public API commands to README.md (the PyPI landing page for dailybot-cli). ## Change Log - New sections: Check-ins, Forms, Kudos, Team — each with examples, flag reference tables, and usage notes - Added User-scoped exit codes table (2/3/4/5/6/7) - Updated Commands table: split into Session / Check-ins / Forms / Kudos / Team / Agent sections for discoverability - Updated 'For humans' intro to mention the new capabilities - Added guided form submit explanation (type-aware prompts table) - Added kudos ambiguity / UUID targeting note Co-authored-by: Cursor <cursoragent@cursor.com>
… user) ## Summary Comprehensive update across 10 documentation files to reflect the new user-scoped public API features added in this branch. ## Change Log - API_REFERENCE.md: added checkin/form/kudos/user commands, flags, exit codes, and HTTP endpoints - ARCHITECTURE.md: added user-scoped modules, updated diagrams, expanded "Where to Add Things" - PRODUCT_SPEC.md: expanded human-facing feature table with all new commands - CONFIGURATION.md: documented DAILYBOT_CONFIG_DIR env var, updated auth resolution scope - ECOSYSTEM_CONTEXT.md: introduced user-scoped endpoint family alongside human and agent - TESTING_GUIDE.md: documented public_api_commands_test.py and form_question_types_test.py - SECURITY.md: added user-scoped privacy considerations (PII, pagination cap, self-kudos) - CLI_COMMAND_BEST_PRACTICES.md: documented shared action module pattern and new short flags - DISPLAY_OUTPUT_BEST_PRACTICES.md: listed new display helpers and spinner messages - AI_AGENT_ONBOARDING.md: updated source reading order with new modules Co-authored-by: Cursor <cursoragent@cursor.com>
Apply ruff format to 5 files that failed CI's format check, and update the agent_init_test fixture to use DAILYBOT_CONFIG_DIR env var so save_agent_profile writes to the isolated tmp_path via get_config_dir(). Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
dailybot checkin list/complete,dailybot form list/submit,dailybot kudos give,dailybot user list— all scoped to the authenticated user's Bearer session (dailybot login)clitest refreshfor hot-reload during development,DAILYBOT_CONFIG_DIRenv override for isolated sandbox configs, docker network integration for local API testingNew commands
dailybot checkin listdailybot checkin complete <uuid>-a index=answerflags)dailybot form listdailybot form submit <uuid>--contentJSON)dailybot kudos give --to <name> --message <msg>dailybot user listAll new commands support
--jsonfor machine-readable output and structured exit codes (2usage error ·3not authenticated ·4permission denied ·5quota exhausted ·6rate limited ·7user aborted).Auth model
New commands use the Bearer token path (
dailybot login→credentials.json) rather than the existing API-key path used bydailybot agent *. Acts as the logged-in user — same visibility and permissions as the webapp.Key implementation decisions
list_users()paginates with_MAX_LIST_PAGES = 50safety cap — prevents an infinite loop against a misbehaving backenddailybot user listomits email addresses (PII minimization for open-source)dailybot form listuses?include=questionsto get question counts in one request (N+1 avoided); backend prompt attmp/backend-form-list-questions-prompt.mddailybot form submitusesGET /v1/forms/{uuid}/for guided prompts; backend prompt attmp/backend-form-detail-prompt.mdDAILYBOT_CONFIG_DIRenv var redirects all~/.config/dailybot/file access for sandbox isolation_HANDLER_MAPdispatch — adding future actions requires only one entry in the mapSecurity audit
docker/local/cli/.env(which contains real dev tokens) is gitignored and not trackedos.chmod(path, 0o600)exit_for_api_errortranslates raw API errors to safe user-facing messageslist_users()→ added_MAX_LIST_PAGES = 50capBugs fixed
TestInteractiveLoginhung forever"Quit"value; after menu refactor only"exit"triggers the exit pathruff --fix+ manual inline of docstring textno-redeferror incollect_checkin_answersanswersvariable tocollectedTest plan
pytest tests/api_client_test.py— new methods + pagination cap testpytest tests/public_api_commands_test.py— all new commands end-to-end (auth guard, JSON mode, all error exit codes, self-kudos rejection, ambiguous receiver)pytest tests/commands_test.py— full existing suite including fixed interactive login testpytest tests/config_test.py—DAILYBOT_CONFIG_DIRisolationruff check dailybot_cli tests→ cleanmypy dailybot_cli→ cleanMade with Cursor