### Install Dashboard Dependencies and Run Dev Server Source: https://github.com/mlabouardy/komiser/blob/develop/dashboard/README.md Navigate to the dashboard directory, install npm packages, and start the development server. Set the API URL using an environment variable. ```shell cd dashboard npm install NEXT_PUBLIC_API_URL=http://localhost:3000 npm run dev ``` -------------------------------- ### Komiser Start Server Output Source: https://context7.com/mlabouardy/komiser/llms.txt Example output when the Komiser server starts successfully, indicating resource fetching and server listening status. ```text INFO Fetching resources workflow has started INFO Server listening on 0.0.0.0:3000 ``` -------------------------------- ### Spin Up Frontend Dev Server Source: https://github.com/mlabouardy/komiser/blob/develop/CONTRIBUTING.md Install frontend dependencies and start the development server. Requires NodeJS 18.x.x LTS. ```bash npm install npm run dev ``` -------------------------------- ### Start Komiser CLI Source: https://github.com/mlabouardy/komiser/blob/develop/docs/configuration/cloud-providers/digital-ocean.mdx Run the Komiser CLI from your command prompt to start the server. Access the dashboard by navigating to `http://localhost:3000` in your browser. ```bash komiser start ``` -------------------------------- ### Example config.toml File Source: https://github.com/mlabouardy/komiser/blob/develop/docs/getting-started/quickstart.mdx An example config.toml file demonstrating how to configure multiple AWS and GCP accounts, along with Postgres data persistence. ```toml [[aws]] name="sandbox" source="CREDENTIALS_FILE" path="./path/to/credentials/file" profile="default" [[aws]] name="staging" source="CREDENTIALS_FILE" path="./path/to/credentials/file" profile="staging-account" [[gcp]] name="production" source="ENVIRONMENT_VARIABLES" # path="./path/to/credentials/file" specify if CREDENTIALS_FILE is used profile="production" [postgres] uri="postgres://postgres:komiser@localhost:5432/komiser?sslmode=disable" ``` -------------------------------- ### Start Komiser Server (`komiser start`) Source: https://context7.com/mlabouardy/komiser/llms.txt Start the Komiser HTTP server, which loads the config file, initializes provider clients, and begins resource fetching. Options include custom config path, port, region restrictions, and disabling telemetry. ```bash # Default: config.toml in current dir, port 3000, all regions komiser start ``` ```bash # Custom config path and port komiser start --config /etc/komiser/config.toml --port 8080 ``` ```bash # Restrict scanning to specific AWS regions komiser start --regions eu-central-1,us-east-1,ap-southeast-1 ``` ```bash # Disable telemetry, suppress verbose logs komiser start --telemetry=false --verbose=false ``` ```bash # Bind to a specific interface komiser start --listen-address 127.0.0.1 --port 3000 ``` -------------------------------- ### Install Komiser Binary Source: https://context7.com/mlabouardy/komiser/llms.txt Download and make the Komiser binary executable for your platform. Homebrew installation is also available. ```bash # Linux wget https://cli.komiser.io/latest/komiser_Linux_x86_64 -O komiser chmod +x komiser ``` ```bash # macOS (Apple Silicon) wget https://cli.komiser.io/latest/komiser_Darwin_arm64 -O komiser chmod +x komiser ``` ```bash # macOS (Intel) wget https://cli.komiser.io/latest/komiser_Darwin_x86_64 -O komiser chmod +x komiser ``` ```bash # Windows wget https://cli.komiser.io/latest/komiser_Windows_x86_64.zip tar -xf komiser_Windows_x86_64.zip ``` ```bash # Homebrew brew tap tailwarden/komiser brew install komiser ``` -------------------------------- ### Install Komiser using Homebrew Source: https://github.com/mlabouardy/komiser/blob/develop/README.md Install Komiser via Homebrew. This includes updating Homebrew, tapping the Komiser repository, and installing the package. It also shows how to ensure you are running the newest version. ```bash brew update brew tap tailwarden/komiser brew install komiser # Make sure you are running the newest version of Komiser: brew update brew reinstall komiser ``` -------------------------------- ### Install Mintlify CLI Source: https://github.com/mlabouardy/komiser/blob/develop/docs/README.md Install the Mintlify CLI globally using npm. This is required to preview documentation changes locally. ```bash npm i -g mintlify ``` -------------------------------- ### Start Komiser Backend Source: https://github.com/mlabouardy/komiser/blob/develop/CONTRIBUTING.md Run the Komiser backend service using the specified configuration file. This command starts the dashboard at http://localhost:3002. ```bash go run *.go start --config ./config.toml ``` -------------------------------- ### Run Mintlify Development Server Source: https://github.com/mlabouardy/komiser/blob/develop/docs/README.md Start the Mintlify development server from the root of your documentation project. Ensure mint.json is present. ```bash mintlify dev ``` -------------------------------- ### Get User Response Example Source: https://github.com/mlabouardy/komiser/blob/develop/docs/api-reference/endpoint/get.mdx This is an example of a successful response from the /api/user endpoint. It indicates the success status, whether a new user group was created, and the details of the user group. ```json { "success": 1, "new_user_group": true, "user_group": { "team_id": 3, "token": "", "name": "Example 1", "provided_id": "example_1" } } ``` -------------------------------- ### Run Development Server with .env file Source: https://github.com/mlabouardy/komiser/blob/develop/dashboard/README.md Start the development server after creating the .env file. ```shell npm run dev ``` -------------------------------- ### Get User Request Example Source: https://github.com/mlabouardy/komiser/blob/develop/docs/api-reference/endpoint/get.mdx Use this cURL command to send a GET request to the /api/user endpoint. Include your authentication token and the necessary user details in the request body. ```bash curl --location --request GET 'https://api.mintlify.com/api/user' \ --header 'Content-Type: application/json' \ --header 'Authorization: Token ' \ --data-raw '{ "user_group_id": "example_1", "name": "Example 1", "mapping": {"40": "213", "134": "386"}, "properties": {"filterValue": "value"} }' ``` -------------------------------- ### Install Komiser Helm Chart Source: https://github.com/mlabouardy/komiser/blob/develop/docs/configuration/cloud-providers/aws.mdx Command to install the Komiser Helm chart with custom values. ```bash helm install -f values.yaml komiser . ``` -------------------------------- ### Run Komiser Development Server Source: https://github.com/mlabouardy/komiser/blob/develop/dashboard/README.md Start the Komiser server from the root folder. Ensure you have a configuration file. ```shell go run *.go start --config /path/to/config.toml ``` -------------------------------- ### Start Komiser Development Server Bash Command Source: https://github.com/mlabouardy/komiser/blob/develop/CONTRIBUTING.md Command to start the Komiser development server after compilation. ```bash ./komiser start ``` -------------------------------- ### Start Komiser Server Source: https://github.com/mlabouardy/komiser/blob/develop/docs/configuration/cloud-providers/k8s.mdx Run this command in your terminal to start the Komiser server after configuring your Kubernetes integration. Access the dashboard at `http://localhost:3000`. ```bash komiser start ``` -------------------------------- ### Example Response for User Creation Source: https://github.com/mlabouardy/komiser/blob/develop/docs/api-reference/endpoint/create.mdx This is an example of a successful JSON response when a user is created. It includes a success indicator and details about the created user group. ```json { "success": 1, "user_group": { "team_id": 3, "token": "", "name": "Example 1", "provided_id": "example_1" } } ``` -------------------------------- ### Komiser CLI Usage Source: https://github.com/mlabouardy/komiser/blob/develop/docs/getting-started/quickstart.mdx Displays the available commands and flags for the Komiser CLI. Use 'komiser start' to run the server. ```bash Usage: komiser start [command] ``` ```bash Available Commands: config Create configuration file help Help about any command start Run Komiser server version Show tool version Flags: -h, --help help for komiser ``` -------------------------------- ### OCI CLI Configuration Setup Source: https://github.com/mlabouardy/komiser/blob/develop/docs/configuration/cloud-providers/oracle.mdx Use the OCI CLI to set up your configuration interactively. This process generates a config file and API key pair. ```bash $ oci setup config Enter a location for your config [/home/opc/.oci/config]: Enter a user OCID: ocid1.user.oc1.. Enter a tenancy OCID: ocid1.tenancy.oc1.. Enter a region by index or name(e.g. 1: ap-chiyoda-1, 2: ap-chuncheon-1, ...: eu-frankfurt-1 Do you want to generate a new API Signing RSA key pair? [Y/n]: Y Enter a directory for your keys to be created [/home/opc/.oci]: Enter a name for your key [oci_api_key]: Enter a passphrase for your private key (empty for no passphrase): ``` -------------------------------- ### Manage Cloud Accounts at Runtime Source: https://context7.com/mlabouardy/komiser/llms.txt Use GET to list existing cloud accounts with their resource counts. Use POST to add new cloud accounts dynamically without restarting Komiser. Adding an account initiates a background resource scan. ```bash # List accounts with resource counts curl -s http://localhost:3000/cloud_accounts | jq . # [ # {"id": 1, "provider": "AWS", "name": "production", # "resources": 842, "status": "CONNECTED", ...} # ] ``` ```bash # Add a new DigitalOcean account at runtime curl -s -X POST http://localhost:3000/cloud_accounts \ -H "Content-Type: application/json" \ -d '{ "provider": "DigitalOcean", "name": "do-new", "credentials": { "token": "dop_v1_XXXXXXXXXXXX" } }' | jq . # {"id": 4, "provider": "DigitalOcean", "name": "do-new", ...} ``` -------------------------------- ### AWS Credentials File Example with IAM Role Source: https://github.com/mlabouardy/komiser/blob/develop/docs/configuration/cloud-providers/aws.mdx Example AWS credentials file configuration using IAM roles for temporary credentials, which is a more secure approach for production environments. ```ini [ADMIN-account] region = eu-central-1 role_arn = arn:aws:iam::ACCOUNT-ID:role/IAMRoleName web_identity_token_file = /var/run/secrets/eks.amazonaws.com/serviceaccount/token [DEV-account] region = eu-central-1 role_arn = arn:aws:iam::ACCOUNT-ID:role/IAMRoleName source_profile = ADMIN-account role_session_name = komiser_session ``` -------------------------------- ### Example Request to Create User Source: https://github.com/mlabouardy/komiser/blob/develop/docs/api-reference/endpoint/create.mdx Use this cURL command to send a POST request to create a new user. Ensure you replace `` with your actual authorization token and provide the `current_token` in the request body. ```bash curl --location --request POST 'https://api.mintlify.com/api/user' \ --header 'Content-Type: application/json' \ --header 'Authorization: Token ' \ --data-raw '{ "current_token": "" }' ``` -------------------------------- ### Update User Response Example Source: https://github.com/mlabouardy/komiser/blob/develop/docs/api-reference/endpoint/update.mdx This is an example of a successful response when updating a user. It indicates the success status and returns details of the updated user group. ```json { "success": 1, "user_group": { "team_id": 113, "token": "", "name": "ok", "provided_id": "6" } } ``` -------------------------------- ### OCI Credentials File Content Source: https://github.com/mlabouardy/komiser/blob/develop/docs/configuration/cloud-providers/oracle.mdx Example content for the OCI credentials file. Ensure the path in config.toml points to this file. ```ini [DEFAULT] user=ocid1.user.oc1.... fingerprint=e8:99:10:45:54:c4:3d:c6:61:9e:42:e0:51:c0:76:cc key_path="/Users/jakepage/.oci/oci_api_key.pem" tenancy=ocid1.tenancy.oc1... region=eu-paris-1 key_password=PASSWORD ``` -------------------------------- ### Multiple OCI Accounts Credentials File Source: https://github.com/mlabouardy/komiser/blob/develop/docs/configuration/cloud-providers/oracle.mdx Example of a credentials file supporting multiple OCI accounts with different profiles (DEFAULT, ADMIN, PRODUCTION). ```ini [DEFAULT] user=ocid1.user.oc1.... fingerprint=e8:99:10:45:54:c4:3d:c6:61:9e:42:e0:51:c0:76:cc key_path="/Users/jakepage/.oci/oci_api_key.pem" tenancy=ocid1.tenancy.oc1... region=eu-paris-1 key_password=PASSWORD [ADMIN] user=ocid1.user.oc1.... fingerprint=e8:99:10:45:54:c4:3d:c6:61:9e:42:e0:51:c0:76:cc key_path="/Users/jakepage/.oci/oci_api_key.pem" tenancy=ocid1.tenancy.oc1... region=eu-paris-1 key_password=PASSWORD [PRODUCTION] user=ocid1.user.oc1.... fingerprint=e8:99:10:45:54:c4:3d:c6:61:9e:42:e0:51:c0:76:cc key_path="/Users/jakepage/.oci/oci_api_key.pem" tenancy=ocid1.tenancy.oc1... region=eu-paris-1 key_password=PASSWORD ``` -------------------------------- ### Trigger a Manual Rescan of Cloud Account Resources Source: https://context7.com/mlabouardy/komiser/llms.txt Use GET to force an immediate re-fetch of all resources for a specific cloud account. Provide the account ID in the URL. ```bash curl -s http://localhost:3000/cloud_accounts/resync/1 | jq . # "Rescan Triggered" ``` -------------------------------- ### Docker Configuration for GCP Source: https://github.com/mlabouardy/komiser/blob/develop/docs/configuration/cloud-providers/gcp.mdx This is an example of how your config.toml should look when running Komiser with Docker. The serviceAccountKeyPath should point to the mounted file within the container. ```toml [[gcp]] name="DockerAccount" serviceAccountKeyPath="/etc/config/serviceAccount.json" [sqlite] file="komiser.db ``` -------------------------------- ### Create Custom View Source: https://context7.com/mlabouardy/komiser/llms.txt Creates a new custom view with a specified name and filters. Example: all untagged production EC2 instances. ```bash curl -s -X POST http://localhost:3000/views \ -H "Content-Type: application/json" \ -d '{ "name": "Untagged Production EC2", "filters": [{"Field": "provider", "Operator": "IS", "Values": ["AWS"]},{"Field": "service", "Operator": "IS", "Values": ["EC2"]},{"Field": "tag", "Operator": "NOT_EXIST", "Values": ["env"]}] }' | jq . ``` -------------------------------- ### Configure Database at Runtime (PostgreSQL) Source: https://context7.com/mlabouardy/komiser/llms.txt Use this endpoint to set up or switch the backing database to PostgreSQL after initial startup. This is typically used during the onboarding flow before any accounts are configured. ```bash curl -s -X POST http://localhost:3000/databases \ -H "Content-Type: application/json" \ -d '{ "type": "POSTGRES", "hostname": "db.example.com:5432", "username": "komiser", "password": "secret", "database": "komiser" }' | jq . # {"message": "database has been configured"} ``` -------------------------------- ### Configure Database at Runtime (SQLite) Source: https://context7.com/mlabouardy/komiser/llms.txt Use this endpoint to set up or switch the backing database to SQLite after initial startup. This is typically used during the onboarding flow before any accounts are configured. ```bash curl -s -X POST http://localhost:3000/databases \ -H "Content-Type: application/json" \ -d '{ "type": "SQLITE", "filePath": "/data/komiser.db" }' | jq . # {"message": "database has been configured"} ``` -------------------------------- ### Configure Database at Runtime Source: https://context7.com/mlabouardy/komiser/llms.txt Sets up or switches the backing database (SQLite or PostgreSQL) after initial startup. This is used during the onboarding flow before any accounts are configured. ```APIDOC ## POST /databases — Configure the Database at Runtime ### Description Sets up or switches the backing database (SQLite or PostgreSQL) after initial startup — used during the onboarding flow before any accounts are configured. ### Method POST ### Endpoint /databases ### Request Body - **type** (string) - Required - Type of the database (e.g., "SQLITE", "POSTGRES") - **filePath** (string) - Optional - Path to the SQLite database file (used when type is "SQLITE") - **hostname** (string) - Optional - Hostname and port for the PostgreSQL server (used when type is "POSTGRES") - **username** (string) - Optional - Username for PostgreSQL authentication (used when type is "POSTGRES") - **password** (string) - Optional - Password for PostgreSQL authentication (used when type is "POSTGRES") - **database** (string) - Optional - Name of the PostgreSQL database (used when type is "POSTGRES") ### Request Example (SQLite) ```json { "type": "SQLITE", "filePath": "/data/komiser.db" } ``` ### Request Example (PostgreSQL) ```json { "type": "POSTGRES", "hostname": "db.example.com:5432", "username": "komiser", "password": "secret", "database": "komiser" } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message indicating the database has been configured. ``` -------------------------------- ### Simple Jest Unit Test Example Source: https://github.com/mlabouardy/komiser/blob/develop/dashboard/README.md Example of a simple Jest unit test for a utility function. Ensure all new utils are tested. ```typescript import formatNumber from './formatNumber'; describe('formatNumber util', () => { it('should format number (over a thousand) in short notation', () => { const result = formatNumber(12345); expect(result).toBe('12K'); }); ... }); ``` -------------------------------- ### Set Up Frontend Environment Variables Source: https://github.com/mlabouardy/komiser/blob/develop/CONTRIBUTING.md Configure the API URL for the frontend development server. Ensure NEXT_PUBLIC_API_URL points to your backend. ```dotenv NEXT_PUBLIC_API_URL=http://localhost:3000 ``` -------------------------------- ### Storybook Story Variation Example Source: https://github.com/mlabouardy/komiser/blob/develop/dashboard/README.md Example of creating a variation for a component in Storybook, such as a 'disabled' state. This is done by replicating the template pattern with different props. ```typescript export const Disabled = Template.bind({}); Disabled.args = { // props to set the component to its disabled state... }; ``` -------------------------------- ### Download Go Dependencies Source: https://github.com/mlabouardy/komiser/blob/develop/CONTRIBUTING.md Run `go mod download` to fetch all the necessary Go dependencies for the project. ```bash go mod download ``` -------------------------------- ### Build Go Artifact with Assets Source: https://github.com/mlabouardy/komiser/blob/develop/CONTRIBUTING.md Generate a Go binary that includes frontend assets. This command bundles the 'dist/' directory into 'template.go'. ```bash go-bindata-assetfs -o template.go dist/ dist/assets/images/ ``` -------------------------------- ### Testing Library Example for Event Firing and State Updates Source: https://github.com/mlabouardy/komiser/blob/develop/dashboard/README.md Example demonstrating event firing and state updates in a test using React Testing Library. This is useful for testing interactive components like dropdowns. ```typescript it('opens the dropdown when clicked', () => { const { getByRole, getByText } = render( {}} /> ); fireEvent.click(getByRole('button')); expect(getByText('Item 1')).toBeInTheDocument(); expect(getByText('Item 2')).toBeInTheDocument(); expect(getByText('Item 3')).toBeInTheDocument(); }); ``` -------------------------------- ### Jest & Testing Library Example for Card Component Source: https://github.com/mlabouardy/komiser/blob/develop/dashboard/README.md Example of using Jest and React Testing Library to test a Card component. Tests ensure the component renders without crashing and displays formatted values. ```typescript import { render, screen } from '@testing-library/react'; import RefreshIcon from '../icons/RefreshIcon'; import Card from './Card'; describe('Card', () => { it('should render card component without crashing', () => { render( } /> ); }); it('should display the value formatted', () => { render( } /> ); const formattedNumber = screen.getByTestId('formattedNumber'); expect(formattedNumber).toHaveTextContent('5K'); }); ... }); ``` -------------------------------- ### Inline Code Example Source: https://github.com/mlabouardy/komiser/blob/develop/docs/essentials/code.mdx To denote a word or phrase as code, enclose it in backticks. ```markdown To denote a `word` or `phrase` as code, enclose it in backticks (`). ``` -------------------------------- ### Get Resource by ID Source: https://context7.com/mlabouardy/komiser/llms.txt Retrieves a single resource by its internal Komiser resource ID. ```APIDOC ## GET /resources — Get Resource by ID ### Description Retrieves a single resource by its internal Komiser resource ID. ### Method GET ### Endpoint /resources ### Parameters #### Query Parameters - **resourceId** (string) - Required - The internal Komiser resource ID. ### Response #### Success Response (200) - **id** (integer) - The unique identifier of the resource. - **resourceId** (string) - The provider-specific resource ID. - **provider** (string) - The cloud provider (e.g., AWS). - **service** (string) - The resource service (e.g., Lambda). - **name** (string) - The resource name. - **cost** (float) - The cost of the resource. - **tags** (array of objects) - Tags associated with the resource. - **metadata** (object) - Additional metadata about the resource. ### Response Example ```json { "id": 42, "resourceId": "arn:aws:lambda:us-east-1:...", "provider": "AWS", "service": "Lambda", "name": "my-function", "cost": 1.24, "tags": [], "metadata": {"runtime": "go1.x", "memory": "128"} } ``` ``` -------------------------------- ### Komiser Configuration File (`config.toml`) Source: https://context7.com/mlabouardy/komiser/llms.txt Configure cloud provider accounts, database persistence, and optional Slack alerting using TOML format. Multiple accounts per provider are supported. ```toml # AWS — using a credentials file with named profiles [[aws]] name = "sandbox" source = "CREDENTIALS_FILE" path = "~/.aws/credentials" profile = "default" [[aws]] name = "staging" source = "CREDENTIALS_FILE" path = "~/.aws/credentials" profile = "staging-account" ``` ```toml # AWS — using environment variables (CI/CD, EC2 instance roles) [[aws]] name = "production" source = "ENVIRONMENT_VARIABLES" ``` ```toml # Azure [[azure]] name = "my-azure" tenantId = "00000000-0000-0000-0000-000000000000" clientId = "00000000-0000-0000-0000-000000000001" clientSecret = "supersecret" subscriptionId = "00000000-0000-0000-0000-000000000002" ``` ```toml # GCP — service account key file [[gcp]] name = "gcp-prod" serviceAccountKeyPath = "/path/to/service-account.json" ``` ```toml # DigitalOcean [[digitalocean]] name = "do-main" token = "dop_v1_XXXXXXXXXXXX" ``` ```toml # Kubernetes [[k8s]] name = "home-cluster" path = "~/.kube/config" contexts = ["production-ctx"] opencostBaseUrl = "http://opencost.default.svc.cluster.local:9003" ``` ```toml # Civo [[civo]] name = "civo-lon" token = "XXXXXXXXXXXX" ``` ```toml # Linode / Akamai [[linode]] name = "linode-main" token = "XXXXXXXXXXXX" ``` ```toml # Tencent Cloud [[tencent]] name = "tencent-main" secret_id = "XXXXXXXXXXXX" secret_key = "XXXXXXXXXXXX" ``` ```toml # Scaleway [[scaleway]] name = "scw-main" organizationId = "XXXXXXXXXXXX" accessKey = "SCWXXXXXXXXX" secretKey = "XXXXXXXXXXXX" ``` ```toml # MongoDB Atlas [[mongodbatlas]] name = "atlas-main" organizationId = "XXXXXXXXXXXX" publicApiKey = "XXXXXXXXXXXX" privateApiKey = "XXXXXXXXXXXX" ``` ```toml # OVH [[ovh]] name = "ovh-eu" endpoint = "ovh-eu" application_key = "XXXXXXXXXXXX" application_secret = "XXXXXXXXXXXX" consumer_key = "XXXXXXXXXXXX" ``` ```toml # Database — choose one [sqlite] file = "komiser.db" ``` ```toml # [postgres] # uri = "postgres://postgres:komiser@localhost:5432/komiser?sslmode=disable" ``` ```toml # Slack alerting (optional) [slack] webhook = "https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXX" reporting = true host = "https://komiser.example.com" # base URL for "Open view" links in alerts ``` -------------------------------- ### Register Azure Provider and Create Service Principal Source: https://github.com/mlabouardy/komiser/blob/develop/docs/configuration/cloud-providers/azure.mdx Use Azure CLI commands to log in, set the subscription, register the Microsoft.Security namespace, and create a service principal with Reader role for Komiser. ```bash export subscriptionId= az account set --subscription $subscriptionId az provider register --namespace 'Microsoft.Security' # Create a service-principal for Komiser to use. az ad sp create-for-rbac --name komiser-sp --scopes /subscriptions/$subscriptionId --role Reader ``` -------------------------------- ### Update allProvidersServices Object TypeScript Source: https://github.com/mlabouardy/komiser/blob/develop/CONTRIBUTING.md Example of adding a new provider and its services to the `allProvidersServices` object in `servicehelper.ts`. ```typescript // dashboard/utils/servicehelper.ts export const allProvidersServices: { [key in Providers | string]: string[] } = { // ... other services new_provider: ['new_service_name'], }; ``` -------------------------------- ### Run Komiser with Docker Source: https://github.com/mlabouardy/komiser/blob/develop/docs/getting-started/quickstart.mdx Run Komiser using Docker, mounting the configuration and credentials files. Ensure to replace '/local/path/to/' with your actual paths. ```bash docker run -v /local/path/to/config.toml:/etc/config/config.toml -v /local/path/to/credentials.yaml:/etc/config/credentials.yaml -d -p 3000:3000 --name komiser tailwarden/komiser:latest komiser start --config /etc/config/config.toml ``` -------------------------------- ### Komiser Alert Payload Example Source: https://context7.com/mlabouardy/komiser/llms.txt This JSON structure represents the payload sent by Komiser when an alert is triggered to a custom endpoint. ```json { "komiser": "3.1.0", "view": "Untagged Production EC2", "message": "Usage alert", "data": 1042, "timestamp": 1711929600 } ``` -------------------------------- ### Add Provider to Union Type TypeScript Source: https://github.com/mlabouardy/komiser/blob/develop/CONTRIBUTING.md Example of adding a new cloud provider to the `Providers` union type in `servicehelper.ts`. ```typescript // dashboard/utils/servicehelper.ts export type Providers = | 'aws' | 'gcp' | 'digitalocean' | 'azure' | 'civo' | 'kubernetes' | 'linode' | 'tencent' | 'oci' | 'scaleway' | 'mongodbatlas' | 'ovh' | 'scaleway' | 'tencent' | 'provider_name'; // Add the new provider here ``` -------------------------------- ### Run Komiser with Docker Source: https://context7.com/mlabouardy/komiser/llms.txt Deploy Komiser as a Docker container, mounting a local configuration file. Ensure the config.toml file exists and is accessible. ```bash docker run -d \ -p 3000:3000 \ -v $(pwd)/config.toml:/config.toml \ --name komiser \ mlaboudy/komiser:latest \ komiser start --config /config.toml # Verify curl http://localhost:3000/stats ``` -------------------------------- ### Delete User Response Example Source: https://github.com/mlabouardy/komiser/blob/develop/docs/api-reference/endpoint/delete.mdx A successful deletion request will return a JSON object with a `success` field indicating the outcome. ```json { "success": 1 } ``` -------------------------------- ### Onboarding Status Check Source: https://context7.com/mlabouardy/komiser/llms.txt Returns whether Komiser has a database configured and at least one cloud account registered. This is used by the UI to drive the first-run wizard. ```APIDOC ## GET /is_onboarded — Onboarding Status Check ### Description Returns whether Komiser has a database configured and at least one cloud account registered — used by the UI to drive the first-run wizard. ### Method GET ### Endpoint /is_onboarded ### Response #### Success Response (200) - **onboarded** (boolean) - Indicates if the onboarding process is complete. - **status** (string) - The current status of the onboarding process (e.g., "PENDING_DATABASE", "PENDING_ACCOUNTS", "COMPLETE"). ``` -------------------------------- ### Check Onboarding Status Source: https://context7.com/mlabouardy/komiser/llms.txt This endpoint returns whether Komiser has a database configured and at least one cloud account registered. It is used by the UI to drive the first-run wizard. ```bash curl -s http://localhost:3000/is_onboarded | jq . # Not yet started: # {"onboarded": false, "status": "PENDING_DATABASE"} # Database configured, no accounts yet: # {"onboarded": false, "status": "PENDING_ACCOUNTS"} # Fully configured: # {"onboarded": true, "status": "COMPLETE"} ``` -------------------------------- ### AWS Credentials File Configuration Source: https://github.com/mlabouardy/komiser/blob/develop/docs/configuration/cloud-providers/aws.mdx Configure Komiser to use a credentials file for AWS authentication. This example specifies a path and profile. ```toml [[aws]] name="sandbox" source="CREDENTIALS_FILE" path="./path/to/credentials/file" profile="default" ``` -------------------------------- ### Make Komiser Executable Source: https://github.com/mlabouardy/komiser/blob/develop/docs/getting-started/installation.mdx After downloading, ensure the Komiser binary has execute permissions. ```bash chmod +x komiser ``` -------------------------------- ### Disable Telemetry Collection Source: https://github.com/mlabouardy/komiser/blob/develop/docs/community-support/telemetry.mdx To disable telemetry data collection, set the --telemetry flag to false when starting Komiser and restart the instance. ```bash komiser start --telemetry false ``` -------------------------------- ### Configure Postgres Database Source: https://github.com/mlabouardy/komiser/blob/develop/docs/configuration/cloud-providers/digital-ocean.mdx Specify the connection URI for your local Postgres database in the `config.toml` file. Komiser expects a 'postgres' role and a 'komiser' database to exist. ```toml [postgres] uri="postgres://postgres:komiser@localhost:5432/komiser?sslmode=disable" ``` -------------------------------- ### Custom Webhook Request Body Example Source: https://github.com/mlabouardy/komiser/blob/develop/docs/guides/alerts.mdx This is the JSON format Komiser sends in the request body to a custom webhook endpoint when an alert is triggered. ```json { "komiser": "", // [string] "view": "", // [string] "message": "Usage/Cost alert", // [string] "data": 32, // [float64] the threshold set for the alert "timestamp": 1685793973 // [int64] number of seconds since January 1, 1970 UTC } ``` -------------------------------- ### Download Komiser for Windows Source: https://github.com/mlabouardy/komiser/blob/develop/README.md Download the Komiser zip archive for Windows (x86_64 architecture) using wget and then extract it. ```bash wget https://cli.komiser.io/latest/komiser_Windows_x86_64.zip tar -xf komiser_Windows_x86_64.zip ``` -------------------------------- ### Get Resource Relation Graph Source: https://context7.com/mlabouardy/komiser/llms.txt Retrieves a list of resources and their linked resources to visualize infrastructure topology. Filters can be applied to narrow down the results. ```bash curl -s -X POST http://localhost:3000/resources/relations \ -H "Content-Type: application/json" \ -d '[{"Field": "service", "Operator": "IS", "Values": ["EC2"]}]' | jq . ``` -------------------------------- ### GCP Provider Configuration TOML Source: https://github.com/mlabouardy/komiser/blob/develop/CONTRIBUTING.md Example TOML configuration for the Google Cloud Platform (GCP) provider, specifying the name, source of credentials, and profile. ```toml [[gcp]] name="production" source="ENVIRONMENT_VARIABLES" # path="./path/to/credentials/file" specify if 'CREDENTIALS_FILE' is used as source profile="production" ``` -------------------------------- ### Get Geographic Resource Distribution Source: https://context7.com/mlabouardy/komiser/llms.txt Returns resource counts mapped to geographic coordinates for each cloud region. Used for visualizing global resource distribution. ```bash curl -s http://localhost:3000/global/locations | jq . ``` -------------------------------- ### View Component in Storybook Source: https://github.com/mlabouardy/komiser/blob/develop/dashboard/README.md Run Storybook to view and interact with components. Pick the desired component, such as 'Card'. ```shell npm run storybook ``` -------------------------------- ### Create .env file for API URL Source: https://github.com/mlabouardy/komiser/blob/develop/dashboard/README.md Alternatively, create a .env file to store the API URL for the development server. ```shell echo "NEXT_PUBLIC_API_URL=http://localhost:3000" > .env ``` -------------------------------- ### Get Distinct Inventory Enumerations Source: https://context7.com/mlabouardy/komiser/llms.txt Fetches unique values for dimensions like regions, providers, services, or accounts. Useful for populating filter dropdowns. ```bash curl -s http://localhost:3000/regions | jq . ``` ```bash curl -s http://localhost:3000/providers | jq . ``` ```bash curl -s http://localhost:3000/services | jq . ``` ```bash curl -s http://localhost:3000/accounts | jq . ``` -------------------------------- ### Configure `config.toml` for Komiser Source: https://github.com/mlabouardy/komiser/blob/develop/CONTRIBUTING.md Define AWS and GCP credentials, and SQLite database file. Supports multiple accounts and profiles. ```toml [[aws]] name="sandbox" source="CREDENTIALS_FILE" path="./path/to/credentials/file" profile="default" [[aws]] name="staging" source="CREDENTIALS_FILE" path="./path/to/credentials/file" profile="staging-account" [[gcp]] name="production" source="ENVIRONMENT_VARIABLES" # path="./path/to/credentials/file" specify if CREDENTIALS_FILE is used profile="production" [sqlite] file="komiser.db" ``` -------------------------------- ### Custom Webhook Test Request Body Example Source: https://github.com/mlabouardy/komiser/blob/develop/docs/guides/alerts.mdx Use this JSON structure to test your custom webhook endpoint. The timestamp will differ based on when the test is performed. ```json { "komiser": "komiser version that will send the webhook", "view": "testing the connection", "message": "test alert", "data": 0, "timestamp": 1685794020 // number of seconds since January 1, 1970 UTC when you test the endpoint hence will be different for you } ``` -------------------------------- ### Configure Postgres Database Source: https://github.com/mlabouardy/komiser/blob/develop/docs/configuration/cloud-providers/gcp.mdx Add this configuration to your config.toml file to use Postgres for data persistence. Komiser expects a 'postgres' role and 'komiser' database to exist. ```toml [postgres] uri="postgres://postgres:komiser@localhost:5432/komiser?sslmode=disable" ``` -------------------------------- ### Navigation With Folder Source: https://github.com/mlabouardy/komiser/blob/develop/docs/essentials/navigation.mdx Configures navigation to include pages located within specific folders. Ensure the path in `mint.json` matches the folder and file structure. ```json "navigation": [ { "group": "Group Name", "pages": ["your-folder/your-page"] } ] ``` -------------------------------- ### Get Resources Breakdown by Dimension Source: https://context7.com/mlabouardy/komiser/llms.txt Provides a grouped breakdown of resource counts by dimension (provider, service, region, or account). Supports excluding specific items. ```bash # Breakdown by service curl -s -X POST http://localhost:3000/global/resources \ -H "Content-Type: application/json" \ -d '{"filter": "service", "exclude": []}' | jq . ``` -------------------------------- ### Get Filtered Statistics Source: https://context7.com/mlabouardy/komiser/llms.txt Calculates resource count, region count, and total cost for resources matching specified filters. Supports filtering by provider and service. ```bash curl -s -X POST http://localhost:3000/stats/search \ -H "Content-Type: application/json" \ -d '[{"Field": "provider", "Operator": "IS", "Values": ["AWS"]},{"Field": "service", "Operator": "IS", "Values": ["S3", "EC2"]}]' | jq . ``` -------------------------------- ### Run Komiser Tests Source: https://github.com/mlabouardy/komiser/blob/develop/CONTRIBUTING.md Execute all engine tests using the `make tests` command. This output shows the status of tests across different provider modules. ```logtalk go test ./... | grep -v /dashboard/ ... ok github.com/tailwarden/komiser/internal (cached) [no tests to run] ? github.com/tailwarden/komiser/providers/aws/ecr [no test files] ? github.com/tailwarden/komiser/providers/aws/ecs [no test files] ? github.com/tailwarden/komiser/providers/aws/efs [no test files] ? github.com/tailwarden/komiser/providers/aws/eks [no test files] ? github.com/tailwarden/komiser/providers/aws/elasticache [no test files] ? github.com/tailwarden/komiser/providers/aws/elb [no test files] ? github.com/tailwarden/komiser/providers/aws/iam [no test files] ok github.com/tailwarden/komiser/providers/aws/ec2 (cached) ? github.com/tailwarden/komiser/providers/aws/kms [no test files] ? github.com/tailwarden/komiser/providers/aws/lambda [no test file ... ``` -------------------------------- ### Re-install Mintlify Dependencies Source: https://github.com/mlabouardy/komiser/blob/develop/docs/README.md If Mintlify dev is not running, run this command to re-install dependencies. This can resolve issues with the development server. ```bash mintlify install ``` -------------------------------- ### Get Resource by ID (API) Source: https://context7.com/mlabouardy/komiser/llms.txt Retrieve details for a single resource using its internal Komiser resource ID. This is useful for inspecting a specific resource's properties. ```bash curl -s "http://localhost:3000/resources?resourceId=arn:aws:lambda:us-east-1:123456789012:function:my-function" | jq . ``` -------------------------------- ### Add Image using Markdown Source: https://github.com/mlabouardy/komiser/blob/develop/docs/essentials/images.mdx Use Markdown syntax to include images. Ensure image file size is under 5MB, or host externally and link the URL. ```md ![title](/path/image.jpg) ``` -------------------------------- ### Get Global Statistics (API) Source: https://context7.com/mlabouardy/komiser/llms.txt Retrieve global statistics including total resources, active regions, and cumulative monthly cost. This endpoint is useful for an overview of your cloud environment. ```bash curl -s http://localhost:3000/stats | jq . ``` ```bash curl -s http://localhost:3000/global/stats | jq . ``` -------------------------------- ### Download Komiser for macOS (AMD) Source: https://github.com/mlabouardy/komiser/blob/develop/README.md Download the Komiser binary for macOS with AMD architecture (Intel Chip) using wget. Save it as 'komiser'. ```bash wget https://cli.komiser.io/latest/komiser_Darwin_x86_64 -O komiser ```