steampipe plugin install linear

Linear + Steampipe

Linear is an application that streamlines issues, sprints, and product roadmaps. It's the new standard for modern software development.

Steampipe is an open-source zero-ETL engine to instantly query cloud APIs using SQL.

List your Linear issues:

select
title,
created_at,
branch_name,
priority
from
linear_issue;
+----------------------------------------------------------------+---------------------------+-------------------------------------------------------+----------+
| title | created_at | branch_name | priority |
+----------------------------------------------------------------+---------------------------+-------------------------------------------------------+----------+
| ProTip: Mouse over this issue & press [Space] | 2023-05-09T12:41:21+05:30 | sourav/tur-8-protip-mouse-over-this-issue-press-space | 4 |
| test linear | 2023-05-09T12:43:21+05:30 | sourav/tur-11-test-linear | 0 |
+----------------------------------------------------------------+---------------------------+-------------------------------------------------------+----------+

Documentation

Quick start

Install

Download and install the latest Linear plugin:

steampipe plugin install linear

Credentials

ItemDescription
CredentialsLinear requires an API Token for all requests.
PermissionsAPI tokens have the same permission as the user who creates them, and if the user permissions change, the API key permissions also change.
RadiusEach connection represents a single Linear Installation.
Resolution1. Credentials explicitly set in a steampipe config file (~/.steampipe/config/linear.spc)
2. Credentials specified in environment variables, e.g., LINEAR_TOKEN.

Configuration

Installing the latest linear plugin will create a config file (~/.steampipe/config/linear.spc) with a single connection named linear:

connection "linear" {
plugin = "linear"
# `token` - API token for your Linear account. It can be a personal access key or OAuth2 token. Required.
# For more information on the API Token, please see https://developers.linear.app/docs/graphql/working-with-the-graphql-api.
# Can also be set with the LINEAR_TOKEN environment variable.
# token = "lin_api_0aHa1iYv9WMTLrEAoSNWlG1RHPy4N5DuM4uILY"
# `page_size` - The requested page size per API request. Default is 50. Optional.
# It is recommended to use lower page size when you are trying to fetch large data set to avoid complexity limit breach.
# page_size = 50
}

Alternatively, you can also use the standard Linear environment variables to obtain credentials only if other argument (token) is not specified in the connection:

export LINEAR_TOKEN=lin_api_0aHa1iYv9WMTLrEAoSNWlG1RHPy4N5DuM4uILY

Postgres FDW

This plugin is available as a native Postgres FDW. Unlike Steampipe CLI, which ships with an embedded Postgres server instance, the Postgres FDW can be installed in any supported Postgres database version.

You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_postgres_installer.sh script:

/bin/sh -c "$(curl -fsSL https://steampipe.io/install/postgres.sh)" -- linear

The installer will prompt you for the plugin name and version, download and install the appropriate files for your OS, system architecture, and Postgres version.

To configure the Postgres FDW, you will create an extension, foreign server, and schema and import the foreign schema.

CREATE EXTENSION IF NOT EXISTS steampipe_postgres_linear;
CREATE SERVER steampipe_linear FOREIGN DATA WRAPPER steampipe_postgres_linear OPTIONS (config '<your_config>');
CREATE SCHEMA linear;
IMPORT FOREIGN SCHEMA linear FROM SERVER steampipe_linear INTO linear;

SQLite Extension

This plugin is available as a SQLite Extension, making the tables available as SQLite virtual tables.

You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_sqlite_installer.sh script:

/bin/sh -c "$(curl -fsSL https://steampipe.io/install/sqlite.sh)" -- linear

The installer will prompt you for the plugin name, version, and destination directory. It will then determine the OS and system architecture, and it will download and install the appropriate package.

To configure the SQLite extension, load the extension module and then run the steampipe_configure_linear function to configure it with plugin-specific options.

$ sqlite3
sqlite> .load ./steampipe_sqlite_extension_linear.so
sqlite> select steampipe_configure_linear('<your_config>');

Export

This plugin is available as a standalone Export CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.

You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh script:

/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- linear

You can pass the configuration to the command with the --config argument:

steampipe_export_linear --config '<your_config>' <table_name>