### Start MCP Server with Short Alias Source: https://github.com/thenamespace/namera/blob/main/apps/docs/content/docs/cli/mcp/start.mdx Example demonstrating the use of the short alias 's' for the 'start' command. ```bash namera mcp s --smart-account my-smart --session-key my-key=my-password ``` -------------------------------- ### Start MCP Server with Multiple Session Keys Source: https://github.com/thenamespace/namera/blob/main/apps/docs/content/docs/cli/mcp/start.mdx Example of starting the MCP server with multiple session keys. ```bash namera mcp start --smart-account my-smart --session-key my-key=my-password --session-key my-other-key=my-other-password ``` -------------------------------- ### Install Namera SDK and Viem Source: https://github.com/thenamespace/namera/blob/main/packages/sdk/README.md Install the Namera SDK and Viem using your preferred package manager. ```bash npm i @namera-ai/sdk viem #or pnpm i @namera-ai/sdk viem #or bun i @namera-ai/sdk viem #or yarn add @namera-ai/sdk viem ``` -------------------------------- ### Start MCP Server in Params Mode Source: https://github.com/thenamespace/namera/blob/main/apps/docs/content/docs/cli/mcp/start.mdx Example of starting the MCP server in params mode, providing all configuration as a JSON string. ```bash namera mcp start --params '{"smartAccountAlias":"my-smart","transport":"http","port":8080,"sessionKeys":{"my-key":"my-password","my-other-key":"my-other-password"}}' ``` -------------------------------- ### Install Namera SDK and Viem Source: https://github.com/thenamespace/namera/blob/main/apps/docs/content/docs/sdk/getting-started.mdx Install the Namera SDK and Viem using npm. Viem handles Ethereum primitives, while Namera builds on it for smart account features. ```bash npm install @namera-ai/sdk viem ``` -------------------------------- ### Start MCP Server with HTTP Transport and Explicit Port Source: https://github.com/thenamespace/namera/blob/main/apps/docs/content/docs/cli/mcp/start.mdx Example of starting the MCP server using HTTP transport and specifying a custom port. ```bash namera mcp start --smart-account my-smart --session-key my-key=my-password --transport http --port 8080 ``` -------------------------------- ### Start MCP Server with Single Session Key (stdio) Source: https://github.com/thenamespace/namera/blob/main/apps/docs/content/docs/cli/mcp/start.mdx Example of starting the MCP server with a single session key using the default stdio transport. ```bash namera mcp start --smart-account my-smart --session-key my-key=my-password ``` -------------------------------- ### Start MCP Server over stdio Source: https://github.com/thenamespace/namera/blob/main/apps/cli/README.md Use this command to start the MCP server using standard input/output. Ensure you provide the smart account and session key details. ```bash namera mcp start --smart-account my-smart --session-key my-session-key=my-password ``` -------------------------------- ### Verify Namera CLI Installation Source: https://github.com/thenamespace/namera/blob/main/apps/docs/content/docs/cli/installation.mdx After installation, verify that the Namera CLI is installed correctly by running the help command. ```bash namera --help ``` -------------------------------- ### Keystore Import Schema Example Source: https://github.com/thenamespace/namera/blob/main/apps/docs/content/docs/cli/keystore/import.mdx An example of the expected JSON structure for the `keystore.import` command when using params mode. It includes fields for alias, private key, and password. ```json { "alias": "my-wallet", "privateKey": "0x...", "password": "my-password" } ``` -------------------------------- ### Install Namera SDK with npm Source: https://github.com/thenamespace/namera/blob/main/apps/docs/content/docs/sdk/installation.mdx Install the Namera SDK and Viem using npm. Viem is a TypeScript interface for Ethereum operations. TypeScript is recommended. ```bash npm i @namera-ai/sdk viem ``` -------------------------------- ### Get MCP Start Schema Source: https://github.com/thenamespace/namera/blob/main/apps/docs/content/docs/cli/schema/index.mdx Use this command to retrieve the JSON schema for the 'mcp.start' command. This schema defines the expected parameters for starting an MCP. ```bash namera schema mcp.start ``` -------------------------------- ### Start Namera MCP Server Source: https://github.com/thenamespace/namera/blob/main/apps/cli/README.md Start the local MCP server for the Namera CLI. Requires specifying the smart account, session key with password, transport protocol, and port. ```bash namera mcp start --smart-account my-smart --session-key my-session-key=my-password --transport http --port 8080 ``` -------------------------------- ### Install Dependencies with pnpm Source: https://github.com/thenamespace/namera/blob/main/README.md Clone the Namera repository and install all project dependencies using pnpm. Ensure Node.js 18+ is installed. ```bash gh repo clone thenamespace/namera cd namera pnpm install ``` -------------------------------- ### Namera CLI: Timestamp Policy Example Source: https://github.com/thenamespace/namera/blob/main/apps/docs/content/docs/cli/session-key/create.mdx Example of a timestamp policy for a session key, defining validity period with start and end timestamps. ```json { "type": "timestamp", "validAfter": 1719916800, "validUntil": 1722604800 } ``` -------------------------------- ### Namera CLI: Gas Policy Example Source: https://github.com/thenamespace/namera/blob/main/apps/docs/content/docs/cli/session-key/create.mdx Example of a gas policy for a session key, limiting total gas spend and optionally requiring a paymaster. ```json { "type": "gas", "amount": "100000000000000000", "enforcePaymaster": false } ``` -------------------------------- ### Install Namera CLI Globally Source: https://github.com/thenamespace/namera/blob/main/apps/cli/README.md Install the Namera CLI globally using npm, pnpm, bun, or yarn. Ensure Node.js 18+ is installed. ```bash npm i -g @namera-ai/cli ``` ```bash pnpm i -g @namera-ai/cli ``` ```bash bun i -g @namera-ai/cli ``` ```bash yarn global add @namera-ai/cli ``` -------------------------------- ### MCP Start Command Source: https://github.com/thenamespace/namera/blob/main/apps/docs/content/docs/cli/mcp/start.mdx Starts the local MCP server. Requires a smart account and at least one session key. Session key passwords are required to unlock the keys. ```APIDOC ## POST /api/mcp/start ### Description Starts the local MCP server using a smart account and session keys. ### Method POST ### Endpoint /api/mcp/start ### Parameters #### Query Parameters - **smart-account** (string) - Optional - Smart account alias to use for the MCP server. - **session-key** (string) - Optional - Session key alias/password pair. Repeat to add multiple keys. - **transport** (string) - Optional - Transport type ('stdio' or 'http', default: 'stdio'). - **port** (number) - Optional - Port for 'http' transport (default: 8080). #### Request Body - **smartAccountAlias** (string) - Required - Smart account alias. - **sessionKeys** (object) - Required - A map of session key aliases to their passwords. - **alias** (string) - Required - The password for the session key. - **transport** (string) - Optional - Transport type ('stdio' or 'http'). - **port** (number) - Optional - Port for 'http' transport. ### Request Example ```json { "smartAccountAlias": "my-smart", "transport": "http", "port": 8080, "sessionKeys": { "my-key": "my-password", "my-other-key": "my-other-password" } } ``` ### Response #### Success Response (200) This command starts a long-running server and does not emit a structured response. #### Response Example (No structured response) ``` -------------------------------- ### Install Namera CLI Globally with npm Source: https://github.com/thenamespace/namera/blob/main/apps/docs/content/docs/cli/installation.mdx Install the Namera CLI globally using npm. This command makes the 'namera' command available system-wide. ```npm npm i -g @namera-ai/cli ``` -------------------------------- ### Namera CLI Smart Account Create - Interactive Example Source: https://github.com/thenamespace/namera/blob/main/apps/docs/content/docs/cli/smart-account/create.mdx This command initiates the smart account creation process interactively, prompting the user for the alias, owner, and password. ```bash namera smart-account create ``` -------------------------------- ### Namera CLI: Call Policy Example (Manual Permission) Source: https://github.com/thenamespace/namera/blob/main/apps/docs/content/docs/cli/session-key/create.mdx Example of a call policy for a session key, manually defining permissions for specific contract targets and value limits. ```json { "type": "call", "policyVersion": "0.0.4", "permissions": [ { "target": "0x1111111111111111111111111111111111111111", "valueLimit": "1000000000000000000" } ] } ``` -------------------------------- ### List Smart Accounts (Default Output) Source: https://github.com/thenamespace/namera/blob/main/apps/docs/content/docs/cli/smart-account/list.mdx Execute the command to list all smart accounts with default formatting. No special setup is required. ```bash namera smart-account list ``` -------------------------------- ### Example Prompts for Agents Source: https://github.com/thenamespace/namera/blob/main/apps/docs/content/docs/cli/getting-started.mdx Markdown examples of prompts for interacting with agents, covering basic lookups, balance checks, contract reads, and transaction execution. ```markdown 1️⃣ Basic Address Lookup > Get my wallet address. 2️⃣ Basic Balance Check > Check my ETH balance on mainnet. 3️⃣ Contract Read > Read USDC totalSupply on Ethereum using the USDC ABI. 4️⃣ Send Tokens > Send 0.01 ETH to 0xabc... on mainnet. 5️⃣ Execute Transaction Batch > send 0.001 eth to 0xabc... and 10 usdc to 0xdef... on mainnet. ``` -------------------------------- ### Start MCP Server Command Usage Source: https://github.com/thenamespace/namera/blob/main/apps/docs/content/docs/cli/mcp/start.mdx This is the general usage command for starting the MCP server. It outlines the available flags for specifying smart accounts, session keys, transport, and port. ```bash namera mcp start [--smart-account ] [--session-key =] [--transport ] [--port ] ``` -------------------------------- ### Namera CLI Smart Account Create - Short Aliases Example Source: https://github.com/thenamespace/namera/blob/main/apps/docs/content/docs/cli/smart-account/create.mdx This command demonstrates creating a smart account using short aliases for the command and flags. ```bash namera sa c -a my-smart -oa my-owner -op my-password -i 0 ``` -------------------------------- ### Namera CLI: Rate Limit Policy Example Source: https://github.com/thenamespace/namera/blob/main/apps/docs/content/docs/cli/session-key/create.mdx Example of a rate limit policy for a session key, restricting the number of requests within a specified interval. ```json { "type": "rate-limit", "interval": 3600, "count": 10, "startAt": 1720000000 } ``` -------------------------------- ### Namera CLI: MCP Server Start Commands Source: https://context7.com/thenamespace/namera/llms.txt Commands to start the Model Context Protocol (MCP) server for AI agent integration. Supports various transports (stdio, http), ports, multiple session keys, and params mode for agents. ```bash # Start MCP server (stdio transport, default) namera mcp start --smart-account my-smart --session-key my-session-key=my-password ``` ```bash # Start MCP server (HTTP transport) namera mcp start --smart-account my-smart --session-key my-session-key=my-password --transport http --port 8080 ``` ```bash # Multiple session keys namera mcp start --smart-account my-smart \ --session-key trading-key=trading-pass \ --session-key admin-key=admin-pass \ --transport http --port 8080 ``` ```bash # Params mode (for agents) namera mcp start --params '{ "smartAccountAlias": "my-smart", "transport": "http", "port": 8080, "sessionKeys": { "my-session-key": "my-password" } }' ``` -------------------------------- ### Create Passkey Session Key Source: https://github.com/thenamespace/namera/blob/main/packages/sdk/README.md This example shows how to create a session key with passkey authentication. It requires policies and a signer to be defined. ```typescript import { createSessionKey, createSessionKeyClient } from "@namera-ai/sdk/session-key"; const webAuthnSessionKey = await toWebAuthnKey({ mode: WebAuthnMode.Register, passkeyName: "session-passkey", passkeyServerUrl: "YOUR_PASSKEY_SERVER_URL", }); const sessionKey = await createSessionKey({ type: "passkey", accountType: "ecdsa", clients: [publicClient], entrypointVersion: "0.7", kernelVersion: "0.3.2", policies: [/* policies */], signer, webAuthnSessionKey, }); ``` -------------------------------- ### Start Development Server Source: https://github.com/thenamespace/namera/blob/main/README.md Run all applications and packages within the monorepo in development mode. This command is used for local development and testing. ```bash pnpm run dev ``` -------------------------------- ### Build and Link Namera CLI from Source Source: https://github.com/thenamespace/namera/blob/main/apps/cli/README.md Build the Namera CLI from source by cloning the repository, installing dependencies, building the CLI, and then linking it globally. ```bash gh repo clone thenamespace/namera cd namera pnpm install cd apps/cli pnpm run build pnpm run start -- --help # or link to global install pnpm link ``` -------------------------------- ### Build Namera SDK from Source Source: https://github.com/thenamespace/namera/blob/main/apps/docs/content/docs/sdk/installation.mdx Clone the Namera repository, install dependencies with pnpm, and build the SDK package. This process is for developers who need to build from source. ```bash gh repo clone thenamespace/namera cd namera pnpm install cd packages/sdk pnpm run build ``` -------------------------------- ### Namera CLI Smart Account Create - Full Flags Example Source: https://github.com/thenamespace/namera/blob/main/apps/docs/content/docs/cli/smart-account/create.mdx This command creates a smart account using all available flags for alias, owner, password, and index. ```bash namera smart-account create -a my-smart -oa my-owner -op my-password -i 0 ``` -------------------------------- ### List All Session Keys Source: https://github.com/thenamespace/namera/blob/main/apps/docs/content/docs/cli/session-key/list.mdx Execute this command to display all session keys stored locally. No additional setup is required. ```bash namera session-key list ``` -------------------------------- ### GET /keystore/info Source: https://github.com/thenamespace/namera/blob/main/apps/docs/content/docs/cli/keystore/info.mdx Fetches metadata for a single keystore by alias. If the alias is not provided, the CLI will prompt for selection. ```APIDOC ## GET /keystore/info ### Description Fetches metadata for a single keystore by alias. ### Method GET ### Endpoint /keystore/info ### Parameters #### Query Parameters - **alias** (string) - Optional - Keystore alias to look up. If missing, prompts for selection. ### Request Example ```json { "alias": "my-wallet" } ``` ### Response #### Success Response (200) - **alias** (string) - Keystore alias - **address** (string) - Derived address - **path** (string) - Filesystem path to the keystore #### Response Example ```json { "alias": "my-wallet", "address": "0x123...", "path": "/path/to/keystore" } ``` ``` -------------------------------- ### Build Namera CLI from Source Source: https://github.com/thenamespace/namera/blob/main/apps/docs/content/docs/cli/installation.mdx Clone the repository, install dependencies, and build the CLI from source. This is for users who want the latest changes or to contribute to the project. ```bash gh repo clone thenamespace/namera cd namera pnpm install cd apps/cli pnpm run build ``` -------------------------------- ### Get Keystore Create Schema Source: https://github.com/thenamespace/namera/blob/main/apps/docs/content/docs/cli/schema/index.mdx Use this command to retrieve the JSON schema for the 'keystore.create' command. This schema defines the expected parameters for creating a keystore. ```bash namera schema keystore.create ``` -------------------------------- ### Create ECDSA Session Key with Paymaster Source: https://github.com/thenamespace/namera/blob/main/apps/docs/content/docs/sdk/session-keys/create.mdx Example demonstrating the creation of an ECDSA session key, integrating a paymaster, and setting up a session key client. ```APIDOC ## POST /api/session-keys ### Description Creates a multichain ECDSA session key with a paymaster and builds a session key client. ### Method POST ### Endpoint /api/session-keys ### Parameters #### Request Body - **signer** (Signer) - Required - The primary signer for the account. - **sessionPrivateKey** (Hex) - Required - The private key for the session key. - **clients** (Client[]) - Required - An array of public clients, one for each chain. - **policies** (Policy[]) - Optional - Policies to define session key usage restrictions. - **type** (string) - Required - The type of session key, e.g., "ecdsa". - **accountType** (string) - Required - The account type, e.g., "ecdsa". - **entrypointVersion** (string) - Required - The version of the entrypoint. - **kernelVersion** (string) - Required - The version of the kernel. - **bundlerTransport** (HttpTransport) - Required - The transport for the bundler. ### Request Example ```json { "signer": "primary_signer_object", "sessionPrivateKey": "0x...", "clients": [{"chain": "mainnet", "transport": "http()"}], "policies": [], "type": "ecdsa", "accountType": "ecdsa", "entrypointVersion": "0.7", "kernelVersion": "0.3.2", "bundlerTransport": "http('https://public.pimlico.io/v2/1/rpc')" } ``` ### Response #### Success Response (200) - **sessionKeyClient** (object) - The created session key client. - **serializedAccount** (string) - The serialized account for the session key. #### Response Example ```json { "sessionKeyClient": "session_key_client_object", "serializedAccount": "serialized_account_string" } ``` ``` -------------------------------- ### Execute Parallel Swap and Lend Source: https://github.com/thenamespace/namera/blob/main/packages/sdk/README.md This example shows how to execute independent operations in parallel on the same chain by assigning unique nonce keys to each batch. ```typescript const receipts = await executeTransaction({ batches: [ { chainId: 1, nonceKey: "swap", calls: [{ to: router, data: swapData }], }, { chainId: 1, nonceKey: "lend", calls: [ { to: dai, data: approveData }, { to: pool, data: supplyData }, ], }, ], clients: [ethClient], }); ``` -------------------------------- ### Namera CLI: Keystore Create Usage Source: https://github.com/thenamespace/namera/blob/main/apps/docs/content/docs/cli/keystore/create.mdx Basic command structure for creating a keystore. Aliases are available for brevity. ```bash namera keystore create [--alias ] [--password ] ``` -------------------------------- ### Import Keystore with Partial Flags Source: https://github.com/thenamespace/namera/blob/main/apps/docs/content/docs/cli/keystore/import.mdx Starts the keystore import process with a specified alias, prompting the user for the password and private key. The private key must be a 32-byte hex string. ```bash namera keystore import --alias my-wallet ``` -------------------------------- ### List All Keystores Source: https://github.com/thenamespace/namera/blob/main/apps/docs/content/docs/cli/keystore/list.mdx Lists every keystore stored on disk and prints basic metadata. This is the default command usage. ```bash namera keystore list ``` -------------------------------- ### Check if Session Key is Installed Source: https://github.com/thenamespace/namera/blob/main/apps/docs/content/docs/sdk/getting-started.mdx Verifies if a session key is already installed on the smart account before sending the first transaction. If not installed, the first UserOperation will automatically install the plugin. ```typescript import { isSessionKeyInstalled } from "@namera-ai/sdk/session-key"; const isInstalled = await isSessionKeyInstalled(publicClient, { accountAddress, sessionKeyAddress: sessionKeySigner.address, }); ``` -------------------------------- ### Import Smart Account with Full Command and JSON Params Source: https://github.com/thenamespace/namera/blob/main/apps/docs/content/docs/cli/smart-account/import.mdx Example of importing a smart account using the full command and providing parameters directly within the `--params` flag. This is useful for scripting and automation. ```bash namera smart-account import --params '{"alias":"my-smart","smartAccountAddress":"0x1bC710cbA70f8Ce638dC5c8F50FDb05d87a7D652","ownerAlias":"my-owner","ownerType":"ecdsa","index":"0","kernelVersion":"0.3.2","entryPointVersion":"0.7"}' ``` -------------------------------- ### Namera CLI: Create Keystore Interactively Source: https://github.com/thenamespace/namera/blob/main/apps/docs/content/docs/cli/keystore/create.mdx Create a keystore without any flags, prompting the user for both alias and password. ```bash namera keystore create ``` -------------------------------- ### Namera CLI: Create Keystore with Flags Source: https://github.com/thenamespace/namera/blob/main/apps/docs/content/docs/cli/keystore/create.mdx Create a keystore by providing both the alias and password directly as flags. ```bash namera keystore create -a my-wallet -p my-password ``` -------------------------------- ### Namera CLI: Create Keystore with Short Aliases Source: https://github.com/thenamespace/namera/blob/main/apps/docs/content/docs/cli/keystore/create.mdx Utilize short aliases for the command and flags to create a keystore. ```bash namera k c -a my-wallet -p my-password ``` -------------------------------- ### Check Session Key Installation Status Source: https://github.com/thenamespace/namera/blob/main/apps/cli/README.md Confirm the installation status of a session key on a specified chain, using its alias. ```bash # Check session key installation status on Ethereum Mainnet namera session-key status --alias my-session-key --chain eth-mainnet ``` -------------------------------- ### Create a Smart Account Source: https://github.com/thenamespace/namera/blob/main/apps/cli/README.md Generate a smart account using the owner's keystore and specifying an initial index. Ensure the owner's password is provided. ```bash # Create a smart account namera smart-account create -a my-smart -oa my-owner -op my-password -i 0 ``` -------------------------------- ### Namera CLI: Signature Caller Policy Example Source: https://github.com/thenamespace/namera/blob/main/apps/docs/content/docs/cli/session-key/create.mdx Example of a signature caller policy for a session key, restricting which addresses can validate signatures. ```json { "type": "signature-caller", "allowedCallers": ["0xabc...", "0xdef..."] } ``` -------------------------------- ### Conventional Commits Example Source: https://github.com/thenamespace/namera/blob/main/README.md Examples of commit messages following the Conventional Commits specification. This format helps in automating changelog generation and versioning. ```bash feat(sdk): add passkey session key support ``` ```bash fix(cli): resolve keystore decryption edge case ``` ```bash docs: update session key policy examples ``` -------------------------------- ### Check and Revoke Session Key Installation Source: https://github.com/thenamespace/namera/blob/main/packages/sdk/README.md Checks if a session key is installed on a client and revokes it if necessary. Requires client and session key signer. ```typescript import { isSessionKeyInstalled, revokeSessionKey } from "@namera-ai/sdk/session-key"; const isInstalled = await isSessionKeyInstalled(publicClient, { accountAddress: client.account.address, sessionKeyAddress: sessionKeySigner.address, }); await revokeSessionKey({ type: "ecdsa", client: accountClient, entrypointVersion: "0.7", kernelVersion: "0.3.2", serializedAccount, signer: sessionKeySigner, }); ``` -------------------------------- ### Create Passkey Session Key and Client Source: https://github.com/thenamespace/namera/blob/main/apps/docs/content/docs/sdk/session-keys/create-passkey-session-key.mdx This example demonstrates how to create a passkey session key with a paymaster and then build a session key client. It requires setting up various clients and configurations, including public client, paymaster client, and account client. ```typescript import { createAccountClient } from "@namera-ai/sdk/account"; import { toWebAuthnKey, WebAuthnMode } from "@namera-ai/sdk/passkey"; import { createSessionKey, createSessionKeyClient, } from "@namera-ai/sdk/session-key"; import { createPublicClient, http } from "viem"; import { createPaymasterClient } from "viem/account-abstraction"; import { generatePrivateKey, privateKeyToAccount } from "viem/accounts"; import { mainnet } from "viem/chains"; export const publicClient = createPublicClient({ chain: mainnet, transport: http(), }); const paymaster = createPaymasterClient({ transport: http("ZERO_DEV_PAYMASTER_URL"), }); const signer = privateKeyToAccount(generatePrivateKey()); const client = await createAccountClient({ bundlerTransport: http("https://public.pimlico.io/v2/1/rpc"), // Public Pimlico RPC chain: mainnet, client: publicClient, entrypointVersion: "0.7", kernelVersion: "0.3.2", paymaster, signer, type: "ecdsa", }); const webAuthnSessionKey = await toWebAuthnKey({ mode: WebAuthnMode.Register, passkeyName: "passkey name", passkeyServerHeaders: {}, passkeyServerUrl: "YOUR_PASSKEY_SERVER_URL", }); const sessionKey = await createSessionKey({ accountType: "ecdsa", clients: [publicClient], entrypointVersion: "0.7", kernelVersion: "0.3.2", policies: [ // Policies for this session key ], signer, type: "passkey", webAuthnSessionKey, }); const serializedAccount = sessionKey.serializedAccounts[0] ?.serializedAccount as string; const sessionKeyClient = await createSessionKeyClient({ bundlerTransport: http("https://public.pimlico.io/v2/1/rpc"), // Public Pimlico RPC chain: mainnet, client: publicClient, entrypointVersion: "0.7", kernelVersion: "0.3.2", serializedAccount, type: "passkey", webAuthnKey: webAuthnSessionKey, }); // Use this to get the session key to send transactions. ``` -------------------------------- ### Start MCP Server with HTTP Transport Source: https://github.com/thenamespace/namera/blob/main/apps/docs/content/docs/cli/getting-started.mdx Starts the MCP server using HTTP transport on a specified port, making it accessible via a local URL. ```bash namera mcp start --smart-account my-smart --session-key my-session-key=my-session-password --transport http --port 8080 ``` -------------------------------- ### Create a Keystore Source: https://github.com/thenamespace/namera/blob/main/apps/cli/README.md Use this command to create a new keystore with a specified alias and password. ```bash # Create a keystore namera keystore create -a my-owner -p my-password ``` -------------------------------- ### Namera CLI: Create Keystore with Params Mode Source: https://github.com/thenamespace/namera/blob/main/apps/docs/content/docs/cli/keystore/create.mdx Create a keystore using the --params flag with a JSON string containing alias and password. ```bash namera keystore create --params '{"alias":"my-wallet","password":"my-password"}' ``` -------------------------------- ### Create Namera Smart Account Source: https://github.com/thenamespace/namera/blob/main/apps/cli/README.md Create a smart account associated with an owner keystore. Use --alias for the smart account and --owner-alias for the owner keystore. ```bash namera smart-account create --alias my-smart --owner-alias my-owner ``` -------------------------------- ### Start MCP Server with Stdio Transport Source: https://github.com/thenamespace/namera/blob/main/apps/docs/content/docs/cli/getting-started.mdx Starts the MCP server using the default stdio transport, suitable for local agent tooling that spawns MCP processes. ```bash namera mcp start --smart-account my-smart --session-key my-session-key=my-session-password ``` -------------------------------- ### Import Keystore Interactively Source: https://github.com/thenamespace/namera/blob/main/apps/docs/content/docs/cli/keystore/import.mdx Initiates the keystore import process without any flags, prompting the user for the alias, password, and private key. The private key must be a 32-byte hex string. ```bash namera keystore import ``` -------------------------------- ### Import Keystore with Short Aliases Source: https://github.com/thenamespace/namera/blob/main/apps/docs/content/docs/cli/keystore/import.mdx Imports a keystore using short command aliases for 'keystore' and 'import', along with flags for alias, password, and private key. The private key must be a 32-byte hex string. ```bash namera k i -a my-wallet -p my-password --private-key 0x1234... ``` -------------------------------- ### Initialize Account Client Source: https://github.com/thenamespace/namera/blob/main/packages/sdk/README.md Create an account client for managing smart accounts. Ensure you have a public client and a signer configured. ```typescript import { createAccountClient } from "@namera-ai/sdk/account"; import { createPublicClient, http, parseEther } from "viem"; import { generatePrivateKey, privateKeyToAccount } from "viem/accounts"; import { mainnet } from "viem/chains"; const publicClient = createPublicClient({ chain: mainnet, transport: http(), }); const signer = privateKeyToAccount(generatePrivateKey()); const accountClient = await createAccountClient({ type: "ecdsa", signer, bundlerTransport: http("https://public.pimlico.io/v2/1/rpc"), chain: mainnet, client: publicClient, entrypointVersion: "0.7", kernelVersion: "0.3.2", }); ``` -------------------------------- ### Create Passkey Session Key and Client Source: https://github.com/thenamespace/namera/blob/main/apps/docs/content/docs/sdk/session-keys/create-passkey-session-key.mdx This example demonstrates the full process of creating an ECDSA smart account client, registering/logging in a passkey, creating a passkey session key with policies, and then building a session key client from the serialized account. Use the sessionKeyClient to send UserOps with the passkey session key. ```typescript import { createAccountClient } from "@namera-ai/sdk/account"; import { toWebAuthnKey, WebAuthnMode } from "@namera-ai/sdk/passkey"; import { createSessionKey, createSessionKeyClient } from "@namera-ai/sdk/session-key"; import { http } from "viem"; import { generatePrivateKey, privateKeyToAccount } from "viem/accounts"; import { mainnet } from "viem/chains"; import { publicClient } from "./clients"; const signer = privateKeyToAccount(generatePrivateKey()); const accountClient = await createAccountClient({ type: "ecdsa", signer, bundlerTransport: http("https://public.pimlico.io/v2/1/rpc"), // Public Pimlico RPC chain: mainnet, client: publicClient, entrypointVersion: "0.7", kernelVersion: "0.3.2", }); const webAuthnSessionKey = await toWebAuthnKey({ mode: WebAuthnMode.Register, // or WebAuthnMode.Login passkeyName: "passkey name", passkeyServerHeaders: {}, passkeyServerUrl: "YOUR_PASSKEY_SERVER_URL", }); const sessionKey = await createSessionKey({ type: "passkey", accountType: "ecdsa", clients: [publicClient], entrypointVersion: "0.7", kernelVersion: "0.3.2", policies: [ // Policies for this session key ], signer, webAuthnSessionKey, }); const serializedAccount = sessionKey.serializedAccounts[0] ?.serializedAccount as string; const sessionKeyClient = await createSessionKeyClient({ type: "passkey", bundlerTransport: http("https://public.pimlico.io/v2/1/rpc"), // Public Pimlico RPC chain: mainnet, client: publicClient, entrypointVersion: "0.7", kernelVersion: "0.3.2", serializedAccount, webAuthnKey: webAuthnSessionKey, }); // Use sessionKeyClient to send UserOps with the passkey session key. ``` -------------------------------- ### Run Namera CLI without Global Install Source: https://github.com/thenamespace/namera/blob/main/apps/docs/content/docs/cli/installation.mdx Execute the Namera CLI using npx without installing it globally. This is useful for running commands without modifying your global environment. ```npm npx @namera-ai/cli --help ``` -------------------------------- ### Import Keystore with Full Flags Source: https://github.com/thenamespace/namera/blob/main/apps/docs/content/docs/cli/keystore/import.mdx Imports a keystore by providing all required flags: alias, password, and private key. The private key must be a 32-byte hex string. ```bash namera keystore import -a my-wallet -p my-password --private-key 0x1234... ``` -------------------------------- ### MCP Start Params Mode JSON Structure Source: https://github.com/thenamespace/namera/blob/main/apps/docs/content/docs/cli/mcp/start.mdx This is the expected JSON structure for the MCP start command when using the --params flag. It defines the smart account, transport, port, and session keys. ```json { "smartAccountAlias": "my-smart", "transport": "stdio", "port": 8080, "sessionKeys": { "my-key": "my-password", "my-other-key": "my-other-password" } } ``` -------------------------------- ### Create Namera Keystore Source: https://github.com/thenamespace/namera/blob/main/apps/cli/README.md Create a new keystore for managing private keys. Use the --alias flag to name the keystore. ```bash namera keystore create --alias my-owner ``` -------------------------------- ### Check if Session Key is Installed Source: https://github.com/thenamespace/namera/blob/main/apps/docs/content/docs/sdk/session-keys/status.mdx Use `isSessionKeyInstalled` to query the account and determine if the session key plugin is already present. This is useful for deciding whether to prompt the user for a first transaction, as the plugin is lazily installed. ```typescript import { isSessionKeyInstalled } from "@namera-ai/sdk/session-key"; import { publicClient } from "./clients"; const isInstalled = await isSessionKeyInstalled(publicClient, { accountAddress: "0x_SMART_ACCOUNT_ADDRESS", sessionKeyAddress: "0x_SESSION_KEY_ADDRESS", }); ``` -------------------------------- ### Create Rate Limit Policy with Future Start Time Source: https://github.com/thenamespace/namera/blob/main/apps/docs/content/docs/sdk/session-keys/policies/rate-limit.mdx Sets a policy that starts enforcing limits at a specific future date and time, allowing one UserOp per hour. The 'startAt' timestamp should be in seconds. ```typescript import { toRateLimitPolicy } from "@namera-ai/sdk/policy"; const startAt = Math.floor(Date.parse("2026-01-01T00:00:00Z") / 1000); const oneHour = 60 * 60; const rateLimitPolicy = toRateLimitPolicy({ count: 1, interval: oneHour, startAt, }); ``` -------------------------------- ### Import Smart Account with Short Aliases and JSON Params Source: https://github.com/thenamespace/namera/blob/main/apps/docs/content/docs/cli/smart-account/import.mdx Demonstrates importing a smart account using the command's short aliases (`sa i`) along with the `--params` flag. This provides a more concise way to execute the import command. ```bash namera sa i --params '{"alias":"my-smart","smartAccountAddress":"0x1bC710cbA70f8Ce638dC5c8F50FDb05d87a7D652","ownerAlias":"my-owner","ownerType":"ecdsa","index":"0","kernelVersion":"0.3.2","entryPointVersion":"0.7"}' ``` -------------------------------- ### isSessionKeyInstalled Source: https://context7.com/thenamespace/namera/llms.txt Checks whether a session key is installed on a smart account. ```APIDOC ## isSessionKeyInstalled Checks whether a session key is installed on a smart account. ### Parameters #### Query Parameters - **accountAddress** (string) - Required - The address of the smart account. - **sessionKeyAddress** (string) - Required - The address of the session key. ### Response #### Success Response (200) - **isInstalled** (boolean) - True if the session key is installed, false otherwise. #### Response Example ```json { "isInstalled": true } ``` ``` -------------------------------- ### Sudo Policy Example Source: https://github.com/thenamespace/namera/blob/main/apps/docs/content/docs/cli/getting-started.mdx A JSON object representing a 'sudo' policy, granting full access. ```json { "type": "sudo" } ``` -------------------------------- ### Check Session Key Status Source: https://github.com/thenamespace/namera/blob/main/apps/docs/content/docs/cli/getting-started.mdx Checks the on-chain installation status of a session key on a specified chain. ```bash namera session-key status --alias my-session-key --chain eth-mainnet ``` -------------------------------- ### Namera CLI: Session Key Creation with Partial Flags Source: https://github.com/thenamespace/namera/blob/main/apps/docs/content/docs/cli/session-key/create.mdx Creates a session key using specified alias and smart account, prompting for passwords and chain/policy configurations. ```bash namera session-key create --alias my-session-key --smart-account my-smart ``` -------------------------------- ### Smart Account Status with Explicit Chain Source: https://github.com/thenamespace/namera/blob/main/apps/docs/content/docs/cli/smart-account/status.mdx Example of checking the status of a smart account with a specific alias and chain. ```bash namera smart-account status -a my-smart --chain eth-mainnet ``` -------------------------------- ### Get session key info with JSON output Source: https://github.com/thenamespace/namera/blob/main/apps/docs/content/docs/cli/session-key/info.mdx Specify JSON output format for the session key information. ```bash namera session-key info --alias my-session-key --output json ``` -------------------------------- ### Get session key info with alias Source: https://github.com/thenamespace/namera/blob/main/apps/docs/content/docs/cli/session-key/info.mdx Provide the session key alias directly to avoid interactive prompts. ```bash namera session-key info --alias my-session-key ``` -------------------------------- ### Check Session Key Status with Explicit Chain Source: https://github.com/thenamespace/namera/blob/main/apps/docs/content/docs/cli/session-key/status.mdx Example of checking session key status for a specific alias and chain. ```bash namera session-key status -a my-session-key --chain eth-mainnet ``` -------------------------------- ### Create Multichain ECDSA Session Key with Paymaster Source: https://github.com/thenamespace/namera/blob/main/apps/docs/content/docs/sdk/session-keys/create.mdx This example demonstrates how to create an account client with a paymaster and then set up a session key client. Ensure you replace the public Bundler URL with a production-ready service to avoid rate limiting. ```typescript import { createAccountClient } from "@namera-ai/sdk/account"; import { createSessionKey, createSessionKeyClient, } from "@namera-ai/sdk/session-key"; import { createPublicClient, http } from "viem"; import { createPaymasterClient } from "viem/account-abstraction"; import { generatePrivateKey, privateKeyToAccount } from "viem/accounts"; import { mainnet } from "viem/chains"; export const publicClient = createPublicClient({ chain: mainnet, transport: http(), }); const paymaster = createPaymasterClient({ transport: http("ZERO_DEV_PAYMASTER_URL"), }); const signer = privateKeyToAccount(generatePrivateKey()); const client = await createAccountClient({ bundlerTransport: http("https://public.pimlico.io/v2/1/rpc"), // Public Pimlico RPC chain: mainnet, client: publicClient, entrypointVersion: "0.7", kernelVersion: "0.3.2", paymaster, signer, type: "ecdsa", }); const sessionPrivateKey = generatePrivateKey(); const sessionKeySigner = privateKeyToAccount(sessionPrivateKey); const sessionKey = await createSessionKey({ accountType: "ecdsa", clients: [publicClient], entrypointVersion: "0.7", kernelVersion: "0.3.2", policies: [ // Policies for this session key ], sessionPrivateKey, signer, type: "ecdsa", }); const serializedAccount = sessionKey.serializedAccounts[0] ?.serializedAccount as string; const sessionKeyClient = await createSessionKeyClient({ bundlerTransport: http("https://public.pimlico.io/v2/1/rpc"), // Public Pimlico RPC chain: mainnet, client: publicClient, entrypointVersion: "0.7", kernelVersion: "0.3.2", serializedAccount, signer: sessionKeySigner, type: "ecdsa", }); // Use this to get the session key to send transactions. ``` -------------------------------- ### Get Smart Account Import Schema Source: https://github.com/thenamespace/namera/blob/main/apps/docs/content/docs/cli/smart-account/import.mdx Retrieve the JSON schema for the `smart-account.import` command to understand the expected structure of the parameters. ```bash namera schema smart-account.import ``` -------------------------------- ### GET /session-key/info Source: https://github.com/thenamespace/namera/blob/main/apps/docs/content/docs/cli/session-key/info.mdx Fetches metadata and policies for a single session key by its alias. If no alias is provided, the CLI will prompt for selection. ```APIDOC ## GET /session-key/info ### Description Fetches metadata and policies for a single session key by its alias. ### Method GET ### Endpoint /session-key/info ### Parameters #### Query Parameters - **alias** (string) - Optional - Session key alias to look up. - **output** (string) - Optional - Output format. Allowed values: `pretty`, `json`, `ndjson`. - **quiet** (boolean) - Optional - Suppress output. - **params** (string) - Optional - Raw JSON parameters for agent-driven execution. ### Request Example ```json { "alias": "my-session-key" } ``` ### Response #### Success Response (200) - **alias** (string) - Session key alias. - **address** or **passKeyName** (string) - Key identifier based on key type. - **smartAccount** (string) - Smart account alias. - **chains** (string) - Comma-separated chain names. - **policies** (string) - Human-readable policy summary for the session key. #### Response Example ```json { "alias": "my-session-key", "address": "0x123...", "smartAccount": "my-smart-account", "chains": "ethereum,polygon", "policies": "Allow transfers up to 1 ETH daily" } ``` ``` -------------------------------- ### Namera CLI: Create Keystore with Alias Source: https://github.com/thenamespace/namera/blob/main/apps/docs/content/docs/cli/keystore/create.mdx Create a keystore specifying the alias, but omitting the password, which will prompt interactively. ```bash namera keystore create --alias my-wallet ``` -------------------------------- ### Get session key info (interactive) Source: https://github.com/thenamespace/namera/blob/main/apps/docs/content/docs/cli/session-key/info.mdx Use this command when you want to be prompted to select a session key if the alias is not provided. ```bash namera session-key info ```