{"id":48521413,"url":"https://github.com/ygncode/meta-cli","last_synced_at":"2026-04-07T21:02:18.874Z","repository":{"id":344587475,"uuid":"1172795904","full_name":"ygncode/meta-cli","owner":"ygncode","description":null,"archived":false,"fork":false,"pushed_at":"2026-03-15T14:22:27.000Z","size":260,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-16T00:29:36.396Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ygncode.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":"docs/roadmap.md","authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-04T17:40:21.000Z","updated_at":"2026-03-15T14:22:31.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/ygncode/meta-cli","commit_stats":null,"previous_names":["ygncode/meta-cli"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/ygncode/meta-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ygncode%2Fmeta-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ygncode%2Fmeta-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ygncode%2Fmeta-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ygncode%2Fmeta-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ygncode","download_url":"https://codeload.github.com/ygncode/meta-cli/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ygncode%2Fmeta-cli/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31528752,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T16:28:08.000Z","status":"ssl_error","status_checked_at":"2026-04-07T16:28:06.951Z","response_time":105,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-04-07T21:01:51.904Z","updated_at":"2026-04-07T21:02:18.851Z","avatar_url":"https://github.com/ygncode.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# meta-cli\n\nCLI for managing Facebook Pages and Messenger via Meta Graph API.\n\n## Install\n\n```bash\ngo install github.com/ygncode/meta-cli/cmd/meta@latest\n```\n\nOr build from source:\n\n```bash\ngit clone https://github.com/ygncode/meta-cli.git\ncd meta-cli\nmake build\n```\n\n## Prerequisites\n\nYou need a Facebook App to get your **App ID** and **App Secret**. In development mode (default), no app review is needed — you can manage your own pages immediately.\n\n### 1. Create a Facebook App\n\n1. Go to [Meta for Developers](https://developers.facebook.com/) and log in\n2. Click **My Apps** \u003e **Create App**\n3. Select **Other** as the use case\n4. Choose **None** as the app type (not \"Business\" — Business apps use \"Facebook Login for Business\" which doesn't support traditional `pages_*` scopes)\n5. Give it a name (e.g. \"My Page CLI\") and click **Create App**\n\n\u003e **Important:** The app type cannot be changed after creation. If you get \"Invalid Scopes\" errors, create a new app with type \"None\".\n\n### 2. Add Use Cases\n\nIn your app dashboard, go to **Use Cases** \u003e **Add Use Cases** and add both:\n\n1. **\"Manage everything on your Page\"** — enables `pages_manage_posts`, `pages_read_engagement`, `pages_read_user_content`, `pages_manage_engagement`, `pages_show_list`\n2. **\"Engage with customers on Messenger from Meta\"** — enables `pages_messaging` for sending/receiving Messenger messages\n\nAfter adding each use case, click **Customize** and make sure all the permissions listed are toggled on.\n\n### 3. Add Facebook Login\n\n1. In the app dashboard, go to **Products** \u003e **Add Product**\n2. Find **Facebook Login** (not \"Facebook Login for Business\") and click **Set Up**\n3. Go to **Facebook Login** \u003e **Settings**\n4. Under **Valid OAuth Redirect URIs**, add `https://localhost/` (or your custom `redirect_uri` if configured)\n5. Click **Save Changes**\n\n\u003e **Tip:** If Facebook rejects `localhost` in the App Domains field, set a custom redirect URI with a TLD:\n\u003e ```bash\n\u003e meta-cli config set redirect_uri \"https://myapp.local/\"\n\u003e ```\n\u003e Then add `myapp.local` to your Facebook App Domains and `https://myapp.local/` to Valid OAuth Redirect URIs.\n\n### 4. Get App ID and App Secret\n\n1. Go to **App Settings** \u003e **Basic**\n2. Copy the **App ID**\n3. Click **Show** next to **App Secret** and copy it\n\n### 5. Connect a Facebook Page\n\nYou must be an admin of the Facebook Page you want to manage. Your pages will be automatically discovered during `auth login`.\n\n\u003e **Note:** In development mode, only you (the app admin) can use the app on your own pages — no app review required.\n\n## Quick Start\n\n```bash\n# --- Auth ---\nmeta-cli auth login --app-id YOUR_APP_ID --app-secret YOUR_APP_SECRET\nmeta-cli auth status\nmeta-cli auth refresh\n\n# --- Pages ---\nmeta-cli pages list\nmeta-cli pages set-default YOUR_PAGE_ID\n\n# --- Posts ---\nmeta-cli post create --message \"Hello from meta-cli!\"\nmeta-cli post create --photo /path/to/image.jpg --message \"Check this out!\"\nmeta-cli post create --photo img1.jpg --photo img2.jpg --message \"Album post\"\nmeta-cli post create --video /path/to/video.mp4 --message \"Watch this!\"\nmeta-cli post create --video clip.mp4 --title \"My Video\" --message \"Description\"\nmeta-cli post create --video clip.mp4 --title \"My Video\" --thumbnail thumb.jpg --message \"Description\"\nmeta-cli post list\nmeta-cli post update POST_ID --message \"Updated text\"\nmeta-cli post delete POST_ID\nmeta-cli post create --message \"Shop now!\" --cta '{\"type\":\"SHOP_NOW\",\"value\":{\"link\":\"https://example.com/shop\"}}'\nmeta-cli post create --message \"Coming soon!\" --schedule \"2026-03-20 14:00\"\nmeta-cli post create --message \"Hello!\" --schedule \"2026-03-20 14:00\" --tz \"Asia/Yangon\"\nmeta-cli post create --video clip.mp4 --message \"Coming soon!\" --schedule \"2026-03-20 14:00\"\nmeta-cli post create --video clip.mp4 --message \"Hello!\" --schedule \"2026-03-20 14:00\" --tz \"Asia/Yangon\"\nmeta-cli post list-scheduled\n\n# --- Reels ---\nmeta-cli reel create --video /path/to/clip.mp4 --message \"Check this out!\"\nmeta-cli reel create --video clip.mp4 --title \"My Reel\" --message \"Description\"\nmeta-cli reel create --video clip.mp4 --message \"Coming soon!\" --schedule \"2026-03-20 14:00\"\nmeta-cli reel create --video clip.mp4 --message \"Hello!\" --schedule \"2026-03-20 14:00\" --tz \"Asia/Yangon\"\n\n# --- Comments ---\nmeta-cli comment list POST_ID\nmeta-cli comment reply COMMENT_ID --message \"Thanks!\"\nmeta-cli comment update COMMENT_ID --message \"Updated reply\"\nmeta-cli comment hide COMMENT_ID\nmeta-cli comment unhide COMMENT_ID\nmeta-cli comment delete COMMENT_ID\n\n# --- Insights ---\nmeta-cli insight page\nmeta-cli insight page --metric page_fans --period lifetime\nmeta-cli insight page --metric page_impressions,page_engaged_users --period week\nmeta-cli insight post POST_ID\nmeta-cli insight post POST_ID --metric post_impressions,post_clicks\n\n# --- Labels ---\nmeta-cli label list\nmeta-cli label create --name \"VIP\"\nmeta-cli label delete LABEL_ID\nmeta-cli label assign LABEL_ID --psid USER_PSID\nmeta-cli label remove LABEL_ID --psid USER_PSID\nmeta-cli label list-by-user USER_PSID\n\n# --- Posts (Visitor \u0026 Tagged) ---\nmeta-cli post list-visitor\nmeta-cli post list-tagged\n\n# --- Events ---\nmeta-cli event list\n\n# --- Ratings ---\nmeta-cli rating list\nmeta-cli rating summary\n\n# --- Reactions ---\nmeta-cli reaction list POST_ID\nmeta-cli reaction list COMMENT_ID\n\n# --- Blocked Users ---\nmeta-cli blocked list\nmeta-cli blocked add USER_ID\nmeta-cli blocked remove USER_ID\n\n# --- Roles ---\nmeta-cli role list\nmeta-cli role assign USER_ID --tasks MANAGE,CREATE_CONTENT\nmeta-cli role remove USER_ID\n\n# --- Messenger ---\nmeta-cli messenger send --psid USER_PSID --message \"Hello!\"\nmeta-cli messenger send --psid USER_PSID --image /path/to/image.jpg\nmeta-cli messenger send --psid USER_PSID --image https://example.com/image.jpg\nmeta-cli messenger send --psid USER_PSID --video /path/to/clip.mp4\nmeta-cli messenger send --psid USER_PSID --message \"Hello!\" --tag HUMAN_AGENT\nmeta-cli messenger send --psid USER_PSID --message \"Pick one\" --quick-reply \"Yes\" --quick-reply \"No\"\nmeta-cli messenger send-template --psid USER_PSID --json '{\"template_type\":\"button\",\"text\":\"Hello\",\"buttons\":[]}'\nmeta-cli messenger list\nmeta-cli messenger history --psid USER_PSID\nmeta-cli messenger conversations\n\n# --- Messenger Profile ---\nmeta-cli messenger profile get\nmeta-cli messenger profile set-greeting \"Welcome!\"\nmeta-cli messenger profile set-get-started GET_STARTED\nmeta-cli messenger profile set-menu --file menu.json\nmeta-cli messenger profile set-ice-breakers --file icebreakers.json\nmeta-cli messenger profile delete --field greeting\n\n# --- Leads ---\nmeta-cli lead create-form --json '{\"name\":\"Contact Form\"}'\nmeta-cli lead list FORM_ID\n\n# --- Config ---\nmeta-cli config set verify_token YOUR_TOKEN\nmeta-cli config get verify_token\nmeta-cli config list\n\n# --- Webhook ---\nmeta-cli webhook serve --verify-token YOUR_TOKEN\nmeta-cli webhook subscribe\nmeta-cli webhook status\nmeta-cli webhook stop\n\n# --- Auto-Reply (with OpenClaw) ---\nmeta-cli config set auto_reply true\nmeta-cli config set hooks_endpoint http://127.0.0.1:18789/hooks/agent\nmeta-cli config set hooks_token YOUR_TOKEN\nmeta-cli config set rag_dir ./knowledge-base\nmeta-cli webhook serve --auto-reply --daemon\n\n# --- RAG ---\nmeta-cli rag index ./docs\nmeta-cli rag search \"how to reset password\"\n```\n\n## Commands\n\n| Command | Description |\n|---------|-------------|\n| `auth login` | Login with Facebook OAuth |\n| `auth status` | Show current auth status |\n| `auth refresh` | Refresh page tokens |\n| `pages list` | List pages you manage |\n| `pages set-default` | Set a default page for commands |\n| `post list` | List recent posts |\n| `post create` | Create a text, photo, video, or link post |\n| `post update` | Update a post's message |\n| `post edit` | Edit a post's message |\n| `post delete` | Delete a post |\n| `post list-scheduled` | List scheduled (unpublished) posts |\n| `reel create` | Publish a reel (short-form video) |\n| `comment list` | List comments on a post |\n| `comment reply` | Reply to a comment |\n| `comment update` | Update a comment's message |\n| `comment hide` | Hide a comment |\n| `comment unhide` | Unhide a comment |\n| `comment delete` | Delete a comment |\n| `insight page` | Show page-level insights |\n| `insight post` | Show post-level insights |\n| `label list` | List all custom labels for the page |\n| `label create` | Create a new custom label |\n| `label delete` | Delete a custom label |\n| `label assign` | Assign a label to a user |\n| `label remove` | Remove a label from a user |\n| `label list-by-user` | List labels assigned to a user |\n| `pages info` | Display page information |\n| `post list-visitor` | List visitor posts on the page |\n| `post list-tagged` | List posts where the page is tagged |\n| `post create --backdate` | Create backdated posts |\n| `post create --targeting` | Create audience-targeted posts |\n| `post create --place` | Create location-tagged posts |\n| `post create --cta` | Add call-to-action button to posts |\n| `event list` | List page events |\n| `rating list` | List page ratings and reviews |\n| `rating summary` | Show overall page rating |\n| `reaction list` | List reactions on a post or comment |\n| `blocked list` | List blocked users |\n| `blocked add` | Block a user |\n| `blocked remove` | Unblock a user |\n| `role list` | List users with page access |\n| `role assign` | Assign roles to a user |\n| `role remove` | Remove a user's page access |\n| `comment private-reply` | Send a private Messenger reply to a comment |\n| `messenger send` | Send a Messenger message (text, attachment, tagged, quick replies) |\n| `messenger send-template` | Send a template message |\n| `messenger list` | List stored messages |\n| `messenger history` | List conversation history with a user |\n| `messenger conversations` | List Messenger conversations from API |\n| `messenger profile get` | Get Messenger profile settings |\n| `messenger profile set-greeting` | Set the Messenger greeting text |\n| `messenger profile set-get-started` | Set the Get Started button payload |\n| `messenger profile set-menu` | Set the persistent menu |\n| `messenger profile set-ice-breakers` | Set ice breaker conversation starters |\n| `messenger profile delete` | Delete a Messenger profile field |\n| `lead create-form` | Create a lead generation form |\n| `lead list` | List leads from a form |\n| `config set` | Set a config value |\n| `config get` | Get a config value |\n| `config list` | List all config values |\n| `webhook serve` | Start webhook HTTP server |\n| `webhook subscribe` | Subscribe page to webhook fields |\n| `webhook status` | Check if webhook server is running |\n| `webhook stop` | Stop the webhook server |\n| `rag index` | Show index stats for documents |\n| `rag search` | Search documents by query |\n\n## Global Flags\n\n| Flag | Description |\n|------|-------------|\n| `--json` | Output as JSON |\n| `--plain` | Output as TSV |\n| `--page` | Page ID to operate on |\n| `--account` | Account name (default: \"default\") |\n\n## Environment Variables\n\n| Variable | Description |\n|----------|-------------|\n| `META_VERIFY_TOKEN` | Webhook verification token |\n\n## Config\n\nConfig file: `~/.meta-cli/config.json`\n\n```json\n{\n  \"default_account\": \"default\",\n  \"default_page\": \"123456789\",\n  \"graph_api_version\": \"v25.0\",\n  \"webhook_port\": 8080,\n  \"rag_dir\": \"./docs\",\n  \"db_path\": \"\",\n  \"verify_token\": \"\",\n  \"redirect_uri\": \"\",\n  \"debounce_seconds\": 3,\n  \"hooks_endpoint\": \"\",\n  \"hooks_token\": \"\",\n  \"auto_reply\": false,\n  \"prompt_template\": \"\"\n}\n```\n\n| Field | Description |\n|-------|-------------|\n| `redirect_uri` | Custom OAuth redirect URI (default: `https://localhost/`) |\n| `debounce_seconds` | Debounce window for message batching (default: 3) |\n| `hooks_endpoint` | OpenClaw webhook endpoint URL |\n| `hooks_token` | OpenClaw webhook auth token |\n| `auto_reply` | Enable auto-reply pipeline (true/false) |\n| `prompt_template` | Go template for agent prompt |\n\n## Permissions\n\nThe following Facebook permissions are requested during login:\n\n- `pages_show_list` - List pages you manage\n- `pages_read_engagement` - Read page engagement data\n- `pages_read_user_content` - Read posts and comments\n- `pages_manage_posts` - Create and delete posts\n- `pages_manage_engagement` - Manage comments\n- `pages_messaging` - Send and receive Messenger messages\n- `pages_manage_metadata` - Manage page metadata\n- `public_profile` - Access public profile\n\n## Architecture\n\n```\ncmd/meta/main.go          Entry point\ncmd_impl/                  Cobra command definitions\ninternal/\n  auth/                    OAuth flow + OS keyring storage\n  config/                  JSON config management\n  graph/                   Meta Graph API HTTP client\n  output/                  Table/JSON/TSV output formatting\n  pages/                   Page listing + info\n  posts/                   Post CRUD + visitor/tagged posts\n  comments/                Comment management + private reply\n  insights/                Page and post analytics\n  labels/                  Custom label management (CRUD + user assignment)\n  messenger/               Send messages + attachments + templates + profile + SQLite store + webhook\n  events/                  Page events listing\n  ratings/                 Page ratings and reviews\n  reactions/               Reaction listing on posts/comments\n  blocked/                 Blocked user management\n  roles/                   User/role management\n  leads/                   Lead generation forms and leads\n  rag/                     TF-IDF search over markdown documents\n  debounce/                Message debouncing (per-user timer)\n  hooks/                   OpenClaw /hooks/agent caller\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fygncode%2Fmeta-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fygncode%2Fmeta-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fygncode%2Fmeta-cli/lists"}