### Install Latchkey and Configure Credentials Source: https://github.com/imbue-ai/latchkey/blob/main/integrations/llm-latchkey/README.md Install the Latchkey CLI globally and set authentication credentials for a service. ```bash npm install -g latchkey latchkey auth set github -H "Authorization: Bearer ghp_..." ``` -------------------------------- ### Install llm-latchkey Plugin Source: https://github.com/imbue-ai/latchkey/blob/main/integrations/llm-latchkey/README.md Install the plugin into the LLM tool environment. ```bash llm install llm-latchkey ``` -------------------------------- ### Install and Configure Latchkey Source: https://context7.com/imbue-ai/latchkey/llms.txt Install the tool globally and configure the browser environment for automated login flows. ```bash # Install latchkey globally npm install -g latchkey # Set up browser for services that support browser-based authentication latchkey ensure-browser # Output example: # Discovering browser using sources: system, playwright # Browser configured successfully: # Path: /usr/bin/google-chrome # Found via: system # Config saved to: ~/.latchkey/config.json ``` -------------------------------- ### Initialize Latchkey development environment Source: https://github.com/imbue-ai/latchkey/blob/main/docs/development.md Run these commands to install dependencies, build the project, and link the local version for development. ```bash npm install && npm run build && npm link ``` -------------------------------- ### Install and Use Latchkey with LLM Tool Source: https://context7.com/imbue-ai/latchkey/llms.txt Commands to install the Latchkey plugin for the LLM tool and execute requests using the latchkey tool. ```bash # Install the LLM plugin llm install llm-latchkey # Use Latchkey as a tool in LLM prompts llm -T latchkey "What are my most recent GitHub notifications?" --td # The model receives a latchkey tool that accepts any latchkey command # Example model invocation: latchkey curl https://api.github.com/notifications ``` -------------------------------- ### Install Latchkey using ClawHub Source: https://github.com/imbue-ai/latchkey/blob/main/README.md Install Latchkey via the ClawHub package manager. This is an alternative method for integrating Latchkey into agent environments. ```bash npx clawhub install latchkey ``` -------------------------------- ### Get Discord user info Source: https://github.com/imbue-ai/latchkey/blob/main/skills/generic/latchkey/SKILL.md Example of a GET request to the Discord API using Latchkey. ```bash latchkey curl 'https://discord.com/api/v10/users/@me' ``` -------------------------------- ### Install Latchkey Globally Source: https://github.com/imbue-ai/latchkey/blob/main/README.md Install the Latchkey package globally using npm. This command is required before using Latchkey CLI commands. ```bash npm install -g latchkey ``` -------------------------------- ### Authenticate and Login to Services Source: https://context7.com/imbue-ai/latchkey/llms.txt Log in to services using browser-based authentication. Use 'browser-prepare' for services that require pre-login setup. ```bash latchkey auth browser discord ``` ```bash latchkey auth browser-prepare linear ``` ```bash latchkey auth browser linear ``` -------------------------------- ### Install Latchkey as a Pi Package Source: https://github.com/imbue-ai/latchkey/blob/main/README.md Install Latchkey using the `pi` package manager, specifying the npm package. This is another method for integrating Latchkey. ```bash pi install npm:latchkey ``` -------------------------------- ### Get service-specific information Source: https://github.com/imbue-ai/latchkey/blob/main/skills/generic/latchkey/SKILL.md Retrieves authentication options and developer notes for a specific service. ```bash latchkey services info slack ``` -------------------------------- ### Configure Latchkey Environment Variables Source: https://context7.com/imbue-ai/latchkey/llms.txt Configure Latchkey behavior using environment variables. Examples include setting a custom storage directory, using a specific curl binary, providing an encryption key, or disabling browser-based login. ```bash export LATCHKEY_DIRECTORY="$HOME/.config/latchkey" ``` ```bash export LATCHKEY_CURL="/usr/local/bin/curl" ``` ```bash export LATCHKEY_ENCRYPTION_KEY="$(openssl rand -base64 32)" ``` ```bash export LATCHKEY_DISABLE_BROWSER=1 ``` ```bash export LATCHKEY_DISABLE_COUNTING=1 ``` ```bash export LATCHKEY_KEYRING_SERVICE_NAME="my-latchkey" ``` ```bash export LATCHKEY_KEYRING_ACCOUNT_NAME="my-account" ``` -------------------------------- ### Create a Slack channel Source: https://github.com/imbue-ai/latchkey/blob/main/skills/generic/latchkey/SKILL.md Example of performing a POST request to the Slack API without manually specifying the Authorization header. ```bash latchkey curl -X POST 'https://slack.com/api/conversations.create' \ -H 'Content-Type: application/json' \ -d '{"name":"my-channel"}' ``` -------------------------------- ### Set Gitlab Credentials Source: https://github.com/imbue-ai/latchkey/blob/main/skills/openclaw/latchkey/SKILL.md Store credentials for a service like GitLab using `latchkey auth set`. This example shows setting credentials with a `PRIVATE-TOKEN` header. ```bash latchkey auth set my-gitlab-instance -H "PRIVATE-TOKEN: " ``` -------------------------------- ### Set Slack Credentials with Latchkey Source: https://github.com/imbue-ai/latchkey/blob/main/README.md Manually store API credentials for a service using `latchkey auth set`. This example shows how to set Slack credentials with an Authorization header. ```bash latchkey auth set slack -H "Authorization: Bearer xoxb-your-token" ``` -------------------------------- ### Retrieve Service Information Source: https://context7.com/imbue-ai/latchkey/llms.txt Get details about a specific service, including authentication options and credential status. ```bash # Get info about the Slack service latchkey services info slack # Output: # { # "type": "built-in", # "baseApiUrls": ["https://slack.com/api/"], # "authOptions": ["browser", "set"], # "credentialStatus": "missing", # "setCredentialsExample": "latchkey auth set slack -H \"Authorization: Bearer xoxb-your-token\"", # "developerNotes": "https://docs.slack.dev/apis/web-api/. Credentials are extracted from the user session, not a bot token." # } # Get info about AWS (uses set-nocurl for credentials) latchkey services info aws # Output: # { # "type": "built-in", # "baseApiUrls": ["/^https:\/\/[^/]*\.amazonaws\.com\//"], # "authOptions": ["set"], # "credentialStatus": "missing", # "setCredentialsExample": "latchkey auth set-nocurl aws ", # "developerNotes": "https://docs.aws.amazon.com/." # } ``` -------------------------------- ### Make HTTP Calls with Latchkey Curl Source: https://github.com/imbue-ai/latchkey/blob/main/README.md Use `latchkey curl` to make HTTP requests, automatically injecting stored credentials. This example demonstrates a POST request to the Slack API. ```bash latchkey curl -X POST 'https://slack.com/api/conversations.create' \ -H 'Content-Type: application/json' \ -d '{"name":"something-urgent"}' ``` -------------------------------- ### Register and use self-hosted services Source: https://github.com/imbue-ai/latchkey/blob/main/README.md Register custom service instances and configure their authentication headers. ```bash latchkey services register my-gitlab-instance --service-family=gitlab --base-api-url="https://gitlab.example.com/api/v4/" ``` ```bash latchkey auth set my-gitlab-instance -H "PRIVATE-TOKEN: " # Agents can then call the API. latchkey curl https://gitlab.example.com/api/v4/user ``` -------------------------------- ### Configure service credentials Source: https://github.com/imbue-ai/latchkey/blob/main/README.md Set up credentials for a service using either browser-based authentication or manual header configuration. ```bash latchkey auth browser slack ``` ```bash latchkey auth set slack -H "Authorization: Bearer xoxb-your-token" ``` -------------------------------- ### Register and use new services Source: https://github.com/imbue-ai/latchkey/blob/main/README.md Define services not natively supported by Latchkey and provide static authentication headers. ```bash latchkey services register mastodon --base-api-url="https://mastodon.social/api/v1/" latchkey auth set mastodon -H "Authorization: Bearer " # Agents can then call the service: latchkey curl https://mastodon.social/api/v1/timelines/public?limit=2 ``` -------------------------------- ### List Supported Services Source: https://context7.com/imbue-ai/latchkey/llms.txt View all supported services, filter by viability, or list only built-in services. ```bash # List all supported services latchkey services list # Output: # [ # "aws", # "calendly", # "coolify", # "discord", # "dropbox", # "figma", # "github", # "gitlab", # "google-analytics", # "google-calendar", # "google-docs", # "google-drive", # "google-sheets", # "gmail", # "linear", # "mailchimp", # "notion", # "sentry", # "slack", # "stripe", # "telegram", # "umami", # "yelp", # "zoom" # ] # List only services with stored credentials or browser login support latchkey services list --viable # List only built-in services (exclude user-registered) latchkey services list --builtin ``` -------------------------------- ### List viable services Source: https://github.com/imbue-ai/latchkey/blob/main/skills/generic/latchkey/SKILL.md Displays services that are currently configured with credentials or support browser-based authentication. ```bash latchkey services list --viable ``` -------------------------------- ### Register Custom Services Source: https://context7.com/imbue-ai/latchkey/llms.txt Register self-hosted service instances or entirely new services. After registration, set credentials and make requests to the custom service endpoint. ```bash latchkey services register my-gitlab --service-family=gitlab \ --base-api-url="https://gitlab.mycompany.com/api/v4/" \ --login-url="https://gitlab.mycompany.com/users/sign_in" ``` ```bash latchkey auth set my-gitlab -H "PRIVATE-TOKEN: glpat-xxxxxxxxxxxxxxxxxxxx" ``` ```bash latchkey curl https://gitlab.mycompany.com/api/v4/user ``` ```bash latchkey services register mastodon --base-api-url="https://mastodon.social/api/v1/" ``` ```bash latchkey auth set mastodon -H "Authorization: Bearer your-mastodon-token" ``` ```bash latchkey curl 'https://mastodon.social/api/v1/timelines/public?limit=2' ``` ```bash latchkey auth clear my-gitlab ``` ```bash latchkey services deregister my-gitlab ``` -------------------------------- ### Execute Latchkey Tool via LLM Source: https://github.com/imbue-ai/latchkey/blob/main/integrations/llm-latchkey/README.md Run a query using the latchkey tool within the LLM interface. ```bash llm -T latchkey "What are my most recent GitHub notifications?" --td ``` -------------------------------- ### Ensure Browser for Latchkey Authentication Source: https://github.com/imbue-ai/latchkey/blob/main/README.md Run `latchkey ensure-browser` to discover and configure a browser for the `latchkey auth browser` subcommand. This may download Chromium via Playwright if no compatible browser is found. ```bash latchkey ensure-browser ``` -------------------------------- ### Generate API key session with codegen Source: https://github.com/imbue-ai/latchkey/blob/main/docs/development.md Use this tool to record a login session and generate an API key for a specific service. ```bash npx tsx scripts/codegen.ts ``` ```bash npx playwright codegen --target=javascript https://login-page.example.com/ ``` -------------------------------- ### Generate Skill File for AI Agents Source: https://context7.com/imbue-ai/latchkey/llms.txt Generate a SKILL.md file for integration with AI agents. This can be printed to stdout or saved directly to a specified directory. ```bash latchkey skill-md ``` ```bash mkdir -p ~/.opencode/skills/latchkey latchkey skill-md > ~/.opencode/skills/latchkey/SKILL.md ``` ```bash npx skills add imbue-ai/latchkey ``` ```bash npx clawhub install latchkey ``` ```bash pi install npm:latchkey ``` -------------------------------- ### Manually Add Latchkey Skill for OpenCode Source: https://github.com/imbue-ai/latchkey/blob/main/README.md Manually integrate Latchkey as a skill for the OpenCode agent. This involves creating a directory and copying the skill metadata file. ```bash mkdir -p ~/.opencode/skills/latchkey latchkey skill-md > ~/.opencode/skills/latchkey/SKILL.md ``` -------------------------------- ### Add Latchkey Skill using Skills.sh Source: https://github.com/imbue-ai/latchkey/blob/main/README.md Integrate Latchkey into your agent environment using the `skills.sh` package manager. This command adds the Latchkey skill. ```bash npx skills add imbue-ai/latchkey ``` -------------------------------- ### Set environment variables for configuration Source: https://github.com/imbue-ai/latchkey/blob/main/README.md Override default Latchkey behaviors using environment variables. ```bash export LATCHKEY_ENCRYPTION_KEY="$(openssl rand -base64 32)" ``` -------------------------------- ### Record browser login sessions Source: https://github.com/imbue-ai/latchkey/blob/main/docs/development.md Captures request/response pairs as JSON files for inspection. Requires jq for viewing the output. ```bash npx tsx scripts/recordBrowserSession.ts ``` ```bash cat path/to/recording/login_session.json | jq -C | less -R ``` -------------------------------- ### Perform Browser-Based Authentication Source: https://context7.com/imbue-ai/latchkey/llms.txt Launch an automated browser flow to extract session-based credentials. ```bash # Login to Slack via browser (extracts session token) latchkey auth browser slack # Opens browser at https://slack.com/signin # User logs in manually # Output: Done # Login to GitHub via browser (creates personal access token) latchkey auth browser github # Opens browser at https://github.com/settings/tokens/new ``` -------------------------------- ### Store service credentials Source: https://github.com/imbue-ai/latchkey/blob/main/skills/generic/latchkey/SKILL.md Commands for manually configuring credentials for services that do not support browser-based authentication. ```bash latchkey auth set my-gitlab-instance -H "PRIVATE-TOKEN: " ``` ```bash latchkey auth set-nocurl aws ``` -------------------------------- ### Manage and clear credentials Source: https://github.com/imbue-ai/latchkey/blob/main/README.md Inspect credential status, re-authenticate, or remove stored credentials. ```bash latchkey services info discord ``` ```bash latchkey auth browser discord ``` ```bash latchkey auth set discord -H "Authorization: ..." ``` ```bash latchkey auth clear discord ``` ```bash latchkey auth clear ``` -------------------------------- ### Make an authenticated curl request Source: https://github.com/imbue-ai/latchkey/blob/main/skills/generic/latchkey/SKILL.md Use this command as a drop-in replacement for standard curl to automatically include necessary authentication headers. ```bash latchkey curl [curl arguments] ``` -------------------------------- ### List Stored Credentials Source: https://context7.com/imbue-ai/latchkey/llms.txt View all stored credentials and their validation status. The output is a JSON object detailing each service's credential type and status. ```bash latchkey auth list ``` -------------------------------- ### Make Authenticated API Requests with Latchkey Curl Source: https://context7.com/imbue-ai/latchkey/llms.txt Execute curl commands with automatic credential injection for various services like Slack, GitHub, Discord, GitLab, AWS, Telegram, Google Drive, and Notion. Standard curl arguments are supported. ```bash latchkey curl -X POST 'https://slack.com/api/conversations.create' \ -H 'Content-Type: application/json' \ -d '{"name":"my-new-channel"}' ``` ```bash latchkey curl https://api.github.com/user ``` ```bash latchkey curl 'https://api.github.com/user/repos?per_page=5' ``` ```bash latchkey curl 'https://discord.com/api/v10/users/@me' ``` ```bash latchkey curl https://gitlab.com/api/v4/user ``` ```bash latchkey curl -X POST 'https://api.linear.app/graphql' \ -H 'Content-Type: application/json' \ -d '{"query": "{ viewer { id name email } }"}' ``` ```bash latchkey curl 'https://s3.amazonaws.com/' ``` ```bash latchkey curl 'https://sts.amazonaws.com/?Action=GetCallerIdentity&Version=2011-06-15' ``` ```bash latchkey curl 'https://api.telegram.org/sendMessage' \ -d 'chat_id=123456789' \ -d 'text=Hello from Latchkey!' ``` ```bash latchkey curl 'https://www.googleapis.com/drive/v3/files?pageSize=10' ``` ```bash latchkey curl 'https://api.notion.com/v1/search' \ -X POST \ -H 'Content-Type: application/json' \ -H 'Notion-Version: 2022-06-28' \ -d '{}' ``` -------------------------------- ### Store Credentials Manually Source: https://context7.com/imbue-ai/latchkey/llms.txt Store API credentials for services using standard header-based authentication. ```bash # Store a GitHub personal access token latchkey auth set github -H "Authorization: Bearer ghp_xxxxxxxxxxxxxxxxxxxx" # Output: Credentials stored. # Store Slack bot token latchkey auth set slack -H "Authorization: Bearer xoxb-your-token" # Output: Credentials stored. # Store GitLab private token latchkey auth set gitlab -H "PRIVATE-TOKEN: glpat-xxxxxxxxxxxxxxxxxxxx" # Output: Credentials stored. # Store Linear API key latchkey auth set linear -H "Authorization: lin_api_xxxxxxxxxxxxxxxxxxxx" # Output: Credentials stored. # Store Discord token latchkey auth set discord -H "Authorization: your-discord-token" # Output: Credentials stored. ``` -------------------------------- ### Programmatic Latchkey Usage in Node.js Source: https://context7.com/imbue-ai/latchkey/llms.txt Accessing services, managing credentials, and injecting them into curl arguments using the Latchkey TypeScript API. ```typescript import { REGISTRY } from 'latchkey/registry'; import { ApiCredentialStore } from 'latchkey/apiCredentialStore'; import { EncryptedStorage } from 'latchkey/encryptedStorage'; import { CONFIG } from 'latchkey/config'; // Get a service by name const slackService = REGISTRY.getByName('slack'); console.log(slackService?.baseApiUrls); // ['https://slack.com/api/'] // Get a service by URL const service = REGISTRY.getByUrl('https://api.github.com/user'); console.log(service?.name); // 'github' // Access credentials programmatically const encryptedStorage = await EncryptedStorage.create({ serviceName: CONFIG.serviceName, accountName: CONFIG.accountName, }); const store = new ApiCredentialStore(CONFIG.credentialStorePath, encryptedStorage); const credentials = store.get('github'); // Inject credentials into curl arguments if (credentials) { const args = credentials.injectIntoCurlCall(['https://api.github.com/user']); console.log(args); // ['-H', 'Authorization: Bearer ghp_xxx...', 'https://api.github.com/user'] } ``` -------------------------------- ### Handle expired credentials for Discord Source: https://github.com/imbue-ai/latchkey/blob/main/skills/generic/latchkey/SKILL.md Workflow to verify credential status and re-authenticate via browser when an API call fails due to invalid credentials. ```bash latchkey services info discord # Check the "credentialStatus" field - shows "invalid" latchkey auth browser discord latchkey curl 'https://discord.com/api/v10/users/@me' ``` -------------------------------- ### Detect Expired Credentials Source: https://github.com/imbue-ai/latchkey/blob/main/skills/openclaw/latchkey/SKILL.md Check the `credentialStatus` field for a service using `latchkey services info discord`. A status of `invalid` indicates expired credentials. ```bash latchkey services info discord ``` -------------------------------- ### Set AWS Credentials (No Curl) Source: https://github.com/imbue-ai/latchkey/blob/main/skills/openclaw/latchkey/SKILL.md Use `latchkey auth set-nocurl` to set credentials for services where they cannot be expressed as static curl arguments, such as AWS access and secret keys. ```bash latchkey auth set-nocurl aws ``` -------------------------------- ### Decrypt credentials file Source: https://github.com/imbue-ai/latchkey/blob/main/docs/development.md Decrypts the encrypted credentials file for inspection during development. ```bash npx tsx scripts/cryptFile.ts decrypt ~/.latchkey/credentials.json.enc ``` -------------------------------- ### Clear Stored Credentials Source: https://context7.com/imbue-ai/latchkey/llms.txt Remove stored credentials for a specific service or clear all stored data. Use the '--yes' flag to bypass confirmation for clearing all credentials. ```bash latchkey auth clear discord ``` ```bash latchkey auth clear ``` ```bash latchkey auth clear --yes ``` -------------------------------- ### Store Non-Curl Credentials Source: https://context7.com/imbue-ai/latchkey/llms.txt Store credentials for services requiring special handling, such as AWS signatures or URL tokens. ```bash # Store AWS credentials (requires access key ID and secret) latchkey auth set-nocurl aws AKIAIOSFODNN7EXAMPLE wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY # Output: Credentials stored. # Store Telegram bot token (embedded in URL path) latchkey auth set-nocurl telegram 123456789:ABCdefGHIjklMNOpqrsTUVwxyz # Output: Credentials stored. ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.