Skip to content

Add follow/unfollow commands to ax - #1

Open
podthesquire wants to merge 1 commit into
mainfrom
follow-unfollow-command
Open

Add follow/unfollow commands to ax#1
podthesquire wants to merge 1 commit into
mainfrom
follow-unfollow-command

Conversation

@podthesquire

Copy link
Copy Markdown
Member

Summary

Adds ax self follow <username> and ax self unfollow <username> commands to the agent-x CLI, following the same pattern as existing self-ops (like/unlike, retweet/unretweet, bookmark/unbookmark).

Changes

FileChange
src/cli/self_ops.rsAdded Follow / Unfollow variants to SelfAction enum
src/api/self_ops.rsAdded follow_user() / unfollow_user() XClient methods
src/api/users.rsMade resolve_user_id() pub for cross-impl access
src/cli/mod.rsUpdated self command description
src/main.rsAdded Follow/Unfollow dispatch to handle_self()
tests/cli_test.rsAdded 3 tests: help output, follow no-auth, unfollow no-auth
README.mdUpdated command tree
skills/agent-x/SKILL.mdUpdated command tree

API

  • Follow: POST /2/users/:id/following with {"target_user_id": "..."}
  • Unfollow: DELETE /2/users/:id/following/:target_user_id

Both resolve usernames to user IDs automatically (supports @handle or raw ID).

Tests

All existing + new tests pass. Pre-existing test_auth_status_no_auth failure is environment-specific (machine has stored OAuth2 tokens).

test result: ok. 19 passed; 1 failed (pre-existing env issue)

Add and to
the agent-x Twitter/X CLI.
Changes:
- src/cli/self_ops.rs: Add Follow/Unfollow variants to SelfAction enum
- src/api/self_ops.rs: Add follow_user/unfollow_user XClient methods
- src/api/users.rs: Make resolve_user_id pub for cross-impl use
- src/cli/mod.rs: Update Self doc comment
- src/main.rs: Add Follow/Unfollow dispatch in handle_self()
- tests/cli_test.rs: Add 3 tests (help includes follow, follow no-auth, unfollow no-auth)
- README.md: Update command tree
- skills/agent-x/SKILL.md: Update command tree
X API v2 endpoints:
POST /2/users/:id/following → follows a user
DELETE /2/users/:id/following/:target → unfollows a user
Both resolve usernames to user IDs automatically.
Uses MutationResult for consistent output formatting.
Sign up for freeto 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

@podthesquire@chris-gilbert