lmconn reference
Complete reference for lmconn global flags and all 56 cli.schema.v1 operations, environment variables, error codes, and exit codes.
Global CLI flags
| Flag | Arguments | Description |
|---|---|---|
| --version / -v | none | Print the lmconn version string (0.2.0) and exit 0. |
| --help / -h | none | Print command usage summary and exit 0. |
| --cli-schema | --json | Print the raw cli.schema.v1 JSON document declaring all 56 operations. |
| --input-json | <json> | Execute an operation from a JSON object {"op":"...","params":{...}} (used by lmscript schema imports). |
| --readonly | none | Refuse any operation whose schema access level is write (error code READONLY, exit code 1). |
Credential, OAuth2, HTTP, GitHub, and LLM operations
| Operation name | CLI command | Access | Parameters | Description |
|---|---|---|---|---|
| cred_set | cred set | write | service, field, value?, env?, stdin? | Store a credential from --value, --env VAR, or --stdin. |
| cred_get | cred get | read | service, field, reveal? | Check credential presence; --reveal returns the secret value for legacy entries. |
| cred_list | cred list | read | none | List stored service names, field names, and timestamps without values. |
| cred_delete | cred delete | write | service, field | Remove one credential record from the SQLite store. |
| cred_path | cred path | read | none | Return the active SQLite credential database file path. |
| cred_store | cred store | write | service, stdin? | Store an issuer/origin-bound nonexportable Bearer or OAuth2 grant from JSON stdin. |
| cred_oauth_store | cred oauth-store | write | service, stdin? | Atomically import an OAuth2 token payload from JSON stdin and return its service handle. |
| cred_encrypt_existing | cred encrypt-existing | write | all? | Encrypt legacy plaintext rows and seal the store, or re-encrypt all rows under the current data key (--all). |
| key_rotate | key rotate | write | data? | Rotate the instance key (rewrapping data keys), or start a new data key for writes (--data). |
| key_backup | key backup | write | to | Write a copy of the instance key to a new 0600 file outside the database directory. |
| oauth_authorize | oauth authorize | write | service, clientId?, clientSecret?, authUrl?, deviceUrl?, tokenUrl?, scope?, authQuery?, authStyle?, owner?, source?, port?, timeout?, noPkce?, autoFollow?, manual? | Run OAuth2 authorization-code flow with PKCE and loopback callback or manual redirect stdin. |
| oauth_device | oauth device | write | service, clientId?, deviceUrl?, tokenUrl?, scope?, owner?, source? | Run RFC 8628 OAuth2 device-code authorization and store the resulting token. |
| oauth_refresh | oauth refresh | write | service | Refresh an expired OAuth2 access token using its stored refresh token. |
| oauth_status | oauth status | read | service | Return read-only OAuth2 authorization status, expiry, and refresh-token presence. |
| oauth_list | oauth list | read | none | List all stored OAuth2 service handles, scopes, expiry timestamps, and metadata. |
| http_request | http request | write | url, method?, header?, data?, dataFile?, auth?, timeout? | Send an HTTP/HTTPS request with optional stored credential or OAuth2 --auth injection. |
| github_user | github user | read | none | Fetch the authenticated GitHub user profile ({login, name, id, publicRepos, auth}). |
| github_repos | github repos | read | org, limit? | List repository names for a GitHub organization or user (limit 1..1000, default 30). |
| llm_providers | llm providers | read | none | List configured API and CLI LLM providers, default models, and key sources. |
| llm_chat | llm chat | write | provider, model?, system?, prompt?, promptFile?, maxTokens?, stdin? | Send a single chat completion prompt to an API or agent CLI provider. |
| llm_probe | llm probe | write | provider* | Execute a live reachability check against one or all configured LLM providers. |
Valkey, LDAPv3, and SAML 2.0 operations
| Operation name | CLI command | Access | Parameters | Description |
|---|---|---|---|---|
| valkey_ping | valkey ping | read | host?, port?, mode?, timeout? | Ping a Valkey or Redis server via native RESP (--mode resp) or REST (--mode rest). |
| valkey_get | valkey get | read | key, host?, port?, mode?, timeout? | Fetch a key value from Valkey. |
| valkey_set | valkey set | write | key, value, host?, port?, mode?, timeout? | Set a key value in Valkey. |
| valkey_del | valkey del | write | key, host?, port?, mode?, timeout? | Delete a key from Valkey. |
| valkey_cmd | valkey cmd | write | command, args*, host?, port?, mode?, timeout? | Execute an arbitrary Valkey or Redis command with arguments. |
| ldap_ping | ldap ping | read | host?, port?, url?, mode?, timeout? | Ping an LDAPv3 server via Root DSE query or lmldap REST health check. |
| ldap_bind | ldap bind | read | dn, password?, host?, port?, url?, mode?, timeout? | Authenticate against an LDAPv3 server using Simple Bind. |
| ldap_whoami | ldap whoami | read | bindDn?, bindPw?, host?, port?, url?, mode?, timeout? | Execute an RFC 4532 Who Am I? extended operation and return authzId. |
| ldap_search | ldap search | read | base?, filter?, scope?, attrs?, sizeLimit?, timeLimit?, format?, bindDn?, bindPw?, host?, port?, url?, mode?, timeout? | Search LDAPv3 entries by base DN, scope, RFC 4515 filter, or RFC 4516 URL in JSON or LDIF format. |
| ldap_get | ldap get | read | dn, attrs?, format?, bindDn?, bindPw?, host?, port?, url?, mode?, timeout? | Retrieve a single LDAP entry by Distinguished Name. |
| ldap_add | ldap add | write | dn, attributes, bindDn?, bindPw?, host?, port?, url?, mode?, timeout? | Create a new LDAP entry from a JSON attributes object. |
| ldap_modify | ldap modify | write | dn, changes, bindDn?, bindPw?, host?, port?, url?, mode?, timeout? | Modify an existing LDAP entry using a JSON object of add, replace, or delete changes. |
| ldap_compare | ldap compare | read | dn, attr, value, bindDn?, bindPw?, host?, port?, url?, mode?, timeout? | Execute an RFC 4511 CompareRequest on an entry attribute and return match status. |
| ldap_del | ldap del | write | dn, bindDn?, bindPw?, host?, port?, url?, mode?, timeout? | Delete an LDAP entry by Distinguished Name. |
| saml_ping | saml ping | read | host?, port?, url?, timeout? | Ping an lmsaml SAML 2.0 server. |
| saml_metadata | saml metadata | read | host?, port?, url?, timeout? | Fetch SAML 2.0 Identity Provider EntityDescriptor XML metadata. |
| saml_sp_metadata | saml sp-metadata | read | host?, port?, url?, timeout? | Fetch SAML 2.0 Service Provider EntityDescriptor XML metadata. |
| saml_users | saml users | read | host?, port?, url?, timeout? | List registered SAML IdP users. |
| saml_user_get | saml user-get | read | user, host?, port?, url?, timeout? | Fetch a SAML IdP user record by username. |
| saml_user_add | saml user-add | write | user, email?, password?, attributes?, host?, port?, url?, timeout? | Create or update a SAML IdP user with email, password, and custom attributes JSON. |
| saml_user_del | saml user-del | write | user, host?, port?, url?, timeout? | Delete a SAML IdP user by username. |
| saml_authn | saml authn | read | user, password, host?, port?, url?, timeout? | Verify SAML IdP user credentials. |
| saml_assertion | saml assertion | read | user, audience?, acsUrl?, requestId?, host?, port?, url?, timeout? | Issue a cryptographically signed SAML 2.0 Response and Assertion XML payload. |
| saml_verify | saml verify | read | response, audience?, acsUrl?, requestId?, host?, port?, url?, timeout? | Cryptographically verify a signed SAML 2.0 Response and Assertion XML payload. |
MCP, ACP, and npm operations
| Operation name | CLI command | Access | Parameters | Description |
|---|---|---|---|---|
| mcp_tools | mcp tools | read | command, arg*, cwd?, timeoutMs? | List available tools exposed by a stdio MCP server. |
| mcp_resources | mcp resources | read | command, arg*, cwd?, timeoutMs? | List available resources exposed by a stdio MCP server. |
| mcp_prompts | mcp prompts | read | command, arg*, cwd?, timeoutMs? | List prompt templates exposed by a stdio MCP server. |
| mcp_read | mcp read | read | command, arg*, cwd?, timeoutMs?, uri | Read a resource URI from a stdio MCP server. |
| mcp_prompt | mcp prompt | read | command, arg*, cwd?, timeoutMs?, name, arguments? | Render a named prompt template with JSON arguments from a stdio MCP server. |
| mcp_call | mcp call | write | command, arg*, cwd?, timeoutMs?, tool, arguments? | Invoke a single tool with JSON arguments on a stdio MCP server. |
| mcp_session | mcp session | write | command, arg*, cwd?, timeoutMs?, call+ | Execute an ordered sequence of tool calls within a single persistent MCP stdio session. |
| acp_chat | acp chat | write | command, arg*, prompt?, promptsFile?, cwd?, timeoutMs?, autoApprove? | Run a single or multi-turn conversation with an Agent Client Protocol (ACP) stdio agent. |
| npm_pack | npm pack | write | dir?, out? | Pack a package directory into a tarball with scripts disabled and report its SHA-512 integrity. |
| npm_publish | npm publish | write | file, credential?, expectIntegrity?, tag?, access? | Publish a tarball using a stored credential and return a nonsecret publication receipt. |
| npm_whoami | npm whoami | read | credential? | Return the authenticated npm registry username for a stored credential. |
Environment variables and exit codes
| Variable or exit code | Default / value | Description |
|---|---|---|
| LMCONN_DB | ~/.lmconn/creds.db | Override the SQLite credential database file location. |
| LMCONN_STORE_MODE | standard (or broker) | Set to broker to enforce nonexportable, origin-bound credential storage and receipt-only HTTP responses. |
| DEEPSEEK_API_KEY / OPENROUTER_API_KEY / OLLAMA_API_KEY | unset | Fallback environment variables for API LLM providers when no SQLite credential is stored. |
| GITHUB_TOKEN / GH_TOKEN | unset | Fallback environment variables for GitHub API authentication. |
| <SERVICE>_API_KEY | unset | Fallback bearer token environment variable for lmconn http request --auth <service>. |
| Exit code 0 | Success | Operation completed and printed {"ok":true,"result":...} (or raw schema JSON for --cli-schema --json). |
| Exit code 1 | Runtime / connector error | Network failure, timeout, missing credential, authentication rejection, or remote protocol error. |
| Exit code 2 | Usage / policy error | Unknown command or flag, missing positional argument, or invalid JSON input. |