@respan/cli 0.7.2 → 0.7.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/oclif.manifest.json +378 -378
  2. package/package.json +1 -1
@@ -1583,18 +1583,10 @@
1583
1583
  "list.js"
1584
1584
  ]
1585
1585
  },
1586
- "integrate:claude-code": {
1586
+ "logs:create": {
1587
1587
  "aliases": [],
1588
1588
  "args": {},
1589
- "description": "Integrate Respan with Claude Code.\n\nInstalls a Stop hook that reads conversation transcripts and sends\nthem to Respan as structured spans (chat, tool, thinking).\n\nScope:\n --global Install hook script + register in ~/.claude/settings.json\n --local Write credentials + enable flag to .claude/settings.local.json\n\nDefault behavior installs the global hook and writes local project config.",
1590
- "examples": [
1591
- "respan integrate claude-code",
1592
- "respan integrate claude-code --disable",
1593
- "respan integrate claude-code --global",
1594
- "respan integrate claude-code --local --project-id my-project",
1595
- "respan integrate claude-code --attrs '{\"env\":\"prod\"}'",
1596
- "respan integrate claude-code --dry-run"
1597
- ],
1589
+ "description": "Create a log span",
1598
1590
  "flags": {
1599
1591
  "api-key": {
1600
1592
  "description": "API key (env: RESPAN_API_KEY)",
@@ -1630,98 +1622,101 @@
1630
1622
  "allowNo": false,
1631
1623
  "type": "boolean"
1632
1624
  },
1633
- "local": {
1634
- "description": "Write per-project config (default)",
1635
- "exclusive": [
1636
- "global"
1637
- ],
1638
- "name": "local",
1639
- "allowNo": false,
1640
- "type": "boolean"
1641
- },
1642
- "global": {
1643
- "description": "Write user-level global config",
1644
- "exclusive": [
1645
- "local"
1646
- ],
1647
- "name": "global",
1648
- "allowNo": false,
1649
- "type": "boolean"
1650
- },
1651
- "enable": {
1652
- "description": "Enable tracing (default)",
1653
- "exclusive": [
1654
- "disable"
1655
- ],
1656
- "name": "enable",
1657
- "allowNo": false,
1658
- "type": "boolean"
1659
- },
1660
- "disable": {
1661
- "description": "Disable tracing",
1662
- "exclusive": [
1663
- "enable"
1664
- ],
1665
- "name": "disable",
1666
- "allowNo": false,
1667
- "type": "boolean"
1668
- },
1669
- "project-id": {
1670
- "description": "Respan project ID (added to metadata / resource attributes)",
1671
- "env": "RESPAN_PROJECT_ID",
1672
- "name": "project-id",
1625
+ "input": {
1626
+ "description": "Input text or JSON",
1627
+ "name": "input",
1628
+ "required": true,
1673
1629
  "hasDynamicHelp": false,
1674
1630
  "multiple": false,
1675
1631
  "type": "option"
1676
1632
  },
1677
- "base-url": {
1678
- "description": "Respan API base URL (for enterprise deployments)",
1679
- "name": "base-url",
1680
- "default": "https://api.respan.ai/api",
1633
+ "output": {
1634
+ "description": "Output text or JSON",
1635
+ "name": "output",
1681
1636
  "hasDynamicHelp": false,
1682
1637
  "multiple": false,
1683
1638
  "type": "option"
1684
1639
  },
1685
- "attrs": {
1686
- "description": "Custom attributes JSON (e.g. '{\"env\":\"prod\"}')",
1687
- "name": "attrs",
1688
- "default": "{}",
1640
+ "model": {
1641
+ "description": "Model name",
1642
+ "name": "model",
1689
1643
  "hasDynamicHelp": false,
1690
1644
  "multiple": false,
1691
1645
  "type": "option"
1692
1646
  },
1693
- "customer-id": {
1694
- "description": "Customer/user identifier for traces (e.g. your name or email)",
1695
- "env": "RESPAN_CUSTOMER_ID",
1696
- "name": "customer-id",
1647
+ "metadata": {
1648
+ "description": "Metadata as JSON string",
1649
+ "name": "metadata",
1697
1650
  "hasDynamicHelp": false,
1698
1651
  "multiple": false,
1699
1652
  "type": "option"
1700
- },
1701
- "span-name": {
1702
- "description": "Root span name for traces (default: claude-code)",
1703
- "name": "span-name",
1653
+ }
1654
+ },
1655
+ "hasDynamicHelp": false,
1656
+ "hiddenAliases": [],
1657
+ "id": "logs:create",
1658
+ "pluginAlias": "@respan/cli",
1659
+ "pluginName": "@respan/cli",
1660
+ "pluginType": "core",
1661
+ "strict": true,
1662
+ "enableJsonFlag": false,
1663
+ "isESM": true,
1664
+ "relativePath": [
1665
+ "dist",
1666
+ "commands",
1667
+ "logs",
1668
+ "create.js"
1669
+ ]
1670
+ },
1671
+ "logs:get": {
1672
+ "aliases": [],
1673
+ "args": {
1674
+ "id": {
1675
+ "description": "Span ID",
1676
+ "name": "id",
1677
+ "required": true
1678
+ }
1679
+ },
1680
+ "description": "Get a specific log span",
1681
+ "flags": {
1682
+ "api-key": {
1683
+ "description": "API key (env: RESPAN_API_KEY)",
1684
+ "env": "RESPAN_API_KEY",
1685
+ "name": "api-key",
1704
1686
  "hasDynamicHelp": false,
1705
1687
  "multiple": false,
1706
1688
  "type": "option"
1707
1689
  },
1708
- "workflow-name": {
1709
- "description": "Workflow name for traces (default: claude-code)",
1710
- "name": "workflow-name",
1690
+ "profile": {
1691
+ "description": "Named profile to use",
1692
+ "name": "profile",
1711
1693
  "hasDynamicHelp": false,
1712
1694
  "multiple": false,
1713
1695
  "type": "option"
1714
1696
  },
1715
- "dry-run": {
1716
- "description": "Preview changes without writing files",
1717
- "name": "dry-run",
1697
+ "json": {
1698
+ "description": "Output as JSON",
1699
+ "name": "json",
1700
+ "allowNo": false,
1701
+ "type": "boolean"
1702
+ },
1703
+ "csv": {
1704
+ "description": "Output as CSV",
1705
+ "name": "csv",
1706
+ "allowNo": false,
1707
+ "type": "boolean"
1708
+ },
1709
+ "verbose": {
1710
+ "char": "v",
1711
+ "description": "Show verbose output",
1712
+ "name": "verbose",
1718
1713
  "allowNo": false,
1719
1714
  "type": "boolean"
1720
1715
  }
1721
1716
  },
1722
1717
  "hasDynamicHelp": false,
1723
1718
  "hiddenAliases": [],
1724
- "id": "integrate:claude-code",
1719
+ "id": "logs:get",
1725
1720
  "pluginAlias": "@respan/cli",
1726
1721
  "pluginName": "@respan/cli",
1727
1722
  "pluginType": "core",
@@ -1731,22 +1726,14 @@
1731
1726
  "relativePath": [
1732
1727
  "dist",
1733
1728
  "commands",
1734
- "integrate",
1735
- "claude-code.js"
1729
+ "logs",
1730
+ "get.js"
1736
1731
  ]
1737
1732
  },
1738
- "integrate:codex-cli": {
1733
+ "logs:list": {
1739
1734
  "aliases": [],
1740
1735
  "args": {},
1741
- "description": "Integrate Respan with Codex CLI.\n\nInstalls a notify hook that reads session JSONL files and sends\nthem to Respan as structured spans (chat, tool, reasoning).\n\nScope:\n --global Install hook script + register notify in ~/.codex/config.toml\n --local Write .codex/respan.json with customer_id, span_name, etc.\n\nDefault behavior installs the global notify hook and writes local project config.",
1742
- "examples": [
1743
- "respan integrate codex-cli",
1744
- "respan integrate codex-cli --disable",
1745
- "respan integrate codex-cli --global",
1746
- "respan integrate codex-cli --local --customer-id frank",
1747
- "respan integrate codex-cli --attrs '{\"env\":\"prod\"}'",
1748
- "respan integrate codex-cli --dry-run"
1749
- ],
1736
+ "description": "List and filter LLM request logs (spans).\n\nSupports pagination, sorting, time range, and server-side filtering.\n\nFILTER SYNTAX: field:operator:value\n\nOPERATORS:\n (empty) Exact match model::gpt-4\n not Not equal status_code:not:200\n gt Greater than cost:gt:0.01\n gte Greater than/equal latency:gte:1.0\n lt Less than cost:lt:0.5\n lte Less than/equal prompt_tokens:lte:100\n contains Contains substring error_message:contains:timeout\n icontains Case-insensitive model:icontains:gpt\n startswith Starts with model:startswith:gpt\n endswith Ends with model:endswith:mini\n in Value in list model:in:gpt-4,gpt-4o\n isnull Is null error_message:isnull:true\n iexact Case-insens. exact status:iexact:success\n\nFILTERABLE FIELDS (logs):\n model, status_code, status, cost, latency, prompt_tokens,\n completion_tokens, customer_identifier, custom_identifier,\n thread_identifier, trace_unique_id, span_name, span_workflow_name,\n environment, log_type, error_message, failed, provider_id,\n deployment_name, prompt_name, prompt_id, unique_id, stream,\n temperature, max_tokens, tokens_per_second, time_to_first_token,\n total_request_tokens, metadata__<key>, scores__<evaluator_id>\n\nEXAMPLES:\n --filter model::gpt-4o --filter cost:gt:0.01\n --filter status_code:not:200\n --filter metadata__env::production\n --filter model:in:gpt-4,gpt-4o",
1750
1737
  "flags": {
1751
1738
  "api-key": {
1752
1739
  "description": "API key (env: RESPAN_API_KEY)",
@@ -1782,98 +1769,75 @@
1782
1769
  "allowNo": false,
1783
1770
  "type": "boolean"
1784
1771
  },
1785
- "local": {
1786
- "description": "Write per-project config (default)",
1787
- "exclusive": [
1788
- "global"
1789
- ],
1790
- "name": "local",
1791
- "allowNo": false,
1792
- "type": "boolean"
1793
- },
1794
- "global": {
1795
- "description": "Write user-level global config",
1796
- "exclusive": [
1797
- "local"
1798
- ],
1799
- "name": "global",
1800
- "allowNo": false,
1801
- "type": "boolean"
1802
- },
1803
- "enable": {
1804
- "description": "Enable tracing (default)",
1805
- "exclusive": [
1806
- "disable"
1807
- ],
1808
- "name": "enable",
1809
- "allowNo": false,
1810
- "type": "boolean"
1811
- },
1812
- "disable": {
1813
- "description": "Disable tracing",
1814
- "exclusive": [
1815
- "enable"
1816
- ],
1817
- "name": "disable",
1818
- "allowNo": false,
1819
- "type": "boolean"
1772
+ "limit": {
1773
+ "description": "Number of results per page (max 1000)",
1774
+ "name": "limit",
1775
+ "default": 50,
1776
+ "hasDynamicHelp": false,
1777
+ "multiple": false,
1778
+ "type": "option"
1820
1779
  },
1821
- "project-id": {
1822
- "description": "Respan project ID (added to metadata / resource attributes)",
1823
- "env": "RESPAN_PROJECT_ID",
1824
- "name": "project-id",
1780
+ "page": {
1781
+ "description": "Page number",
1782
+ "name": "page",
1783
+ "default": 1,
1825
1784
  "hasDynamicHelp": false,
1826
1785
  "multiple": false,
1827
1786
  "type": "option"
1828
1787
  },
1829
- "base-url": {
1830
- "description": "Respan API base URL (for enterprise deployments)",
1831
- "name": "base-url",
1832
- "default": "https://api.respan.ai/api",
1788
+ "sort-by": {
1789
+ "description": "Sort field (prefix with - for descending, e.g. -cost, -latency)",
1790
+ "name": "sort-by",
1833
1791
  "hasDynamicHelp": false,
1834
1792
  "multiple": false,
1835
1793
  "type": "option"
1836
1794
  },
1837
- "attrs": {
1838
- "description": "Custom attributes JSON (e.g. '{\"env\":\"prod\"}')",
1839
- "name": "attrs",
1840
- "default": "{}",
1795
+ "start-time": {
1796
+ "description": "Start time filter (ISO 8601)",
1797
+ "name": "start-time",
1841
1798
  "hasDynamicHelp": false,
1842
1799
  "multiple": false,
1843
1800
  "type": "option"
1844
1801
  },
1845
- "customer-id": {
1846
- "description": "Customer/user identifier for traces (e.g. your name or email)",
1847
- "env": "RESPAN_CUSTOMER_ID",
1848
- "name": "customer-id",
1802
+ "end-time": {
1803
+ "description": "End time filter (ISO 8601)",
1804
+ "name": "end-time",
1849
1805
  "hasDynamicHelp": false,
1850
1806
  "multiple": false,
1851
1807
  "type": "option"
1852
1808
  },
1853
- "span-name": {
1854
- "description": "Root span name for traces (default: claude-code)",
1855
- "name": "span-name",
1809
+ "filter": {
1810
+ "description": "Filter in field:operator:value format (repeatable)",
1811
+ "name": "filter",
1812
+ "hasDynamicHelp": false,
1813
+ "multiple": true,
1814
+ "type": "option"
1815
+ },
1816
+ "all-envs": {
1817
+ "description": "Include all environments (true/false)",
1818
+ "name": "all-envs",
1856
1819
  "hasDynamicHelp": false,
1857
1820
  "multiple": false,
1858
1821
  "type": "option"
1859
1822
  },
1860
- "workflow-name": {
1861
- "description": "Workflow name for traces (default: claude-code)",
1862
- "name": "workflow-name",
1823
+ "is-test": {
1824
+ "description": "Filter by test (true) or production (false) environment",
1825
+ "name": "is-test",
1863
1826
  "hasDynamicHelp": false,
1864
1827
  "multiple": false,
1865
1828
  "type": "option"
1866
1829
  },
1867
- "dry-run": {
1868
- "description": "Preview changes without writing files",
1869
- "name": "dry-run",
1870
- "allowNo": false,
1871
- "type": "boolean"
1830
+ "include-fields": {
1831
+ "description": "Comma-separated fields to include in response",
1832
+ "name": "include-fields",
1833
+ "hasDynamicHelp": false,
1834
+ "multiple": false,
1835
+ "type": "option"
1872
1836
  }
1873
1837
  },
1874
1838
  "hasDynamicHelp": false,
1875
1839
  "hiddenAliases": [],
1876
- "id": "integrate:codex-cli",
1840
+ "id": "logs:list",
1877
1841
  "pluginAlias": "@respan/cli",
1878
1842
  "pluginName": "@respan/cli",
1879
1843
  "pluginType": "core",
@@ -1883,21 +1847,14 @@
1883
1847
  "relativePath": [
1884
1848
  "dist",
1885
1849
  "commands",
1886
- "integrate",
1887
- "codex-cli.js"
1850
+ "logs",
1851
+ "list.js"
1888
1852
  ]
1889
1853
  },
1890
- "integrate:gemini-cli": {
1854
+ "logs:summary": {
1891
1855
  "aliases": [],
1892
1856
  "args": {},
1893
- "description": "Integrate Respan with Gemini CLI.\n\nInstalls an AfterModel hook that captures LLM request/response data\nand sends it to Respan as structured spans with model, token counts,\nand input/output.\n\nScope:\n --global Write to ~/.gemini/settings.json (default)\n --local Write to .gemini/settings.json in project root\n\nGemini CLI ignores workspace-level telemetry settings, so --global is the default.",
1894
- "examples": [
1895
- "respan integrate gemini-cli",
1896
- "respan integrate gemini-cli --disable",
1897
- "respan integrate gemini-cli --local",
1898
- "respan integrate gemini-cli --project-id my-project --attrs '{\"env\":\"prod\"}'",
1899
- "respan integrate gemini-cli --dry-run"
1900
- ],
1857
+ "description": "Get aggregated summary statistics for log spans in a time range.\n\nReturns total cost, total tokens, request count, and score summaries.\n\nFILTER SYNTAX: field:operator:value\n\nOPERATORS:\n (empty) Exact match model::gpt-4\n not Not equal status_code:not:200\n gt Greater than cost:gt:0.01\n gte Greater than/equal latency:gte:1.0\n lt Less than cost:lt:0.5\n lte Less than/equal prompt_tokens:lte:100\n contains Contains substring error_message:contains:timeout\n icontains Case-insensitive model:icontains:gpt\n startswith Starts with model:startswith:gpt\n endswith Ends with model:endswith:mini\n in Value in list model:in:gpt-4,gpt-4o\n isnull Is null error_message:isnull:true\n iexact Case-insens. exact status:iexact:success\n\nFILTERABLE FIELDS (logs):\n model, status_code, status, cost, latency, prompt_tokens,\n completion_tokens, customer_identifier, custom_identifier,\n thread_identifier, trace_unique_id, span_name, span_workflow_name,\n environment, log_type, error_message, failed, provider_id,\n deployment_name, prompt_name, prompt_id, unique_id, stream,\n temperature, max_tokens, tokens_per_second, time_to_first_token,\n total_request_tokens, metadata__<key>, scores__<evaluator_id>\n\nEXAMPLES:\n --filter model::gpt-4o --filter cost:gt:0.01\n --filter status_code:not:200\n --filter metadata__env::production\n --filter model:in:gpt-4,gpt-4o",
1901
1858
  "flags": {
1902
1859
  "api-key": {
1903
1860
  "description": "API key (env: RESPAN_API_KEY)",
@@ -1933,98 +1890,47 @@
1933
1890
  "allowNo": false,
1934
1891
  "type": "boolean"
1935
1892
  },
1936
- "local": {
1937
- "description": "Write per-project config (default)",
1938
- "exclusive": [
1939
- "global"
1940
- ],
1941
- "name": "local",
1942
- "allowNo": false,
1943
- "type": "boolean"
1944
- },
1945
- "global": {
1946
- "description": "Write user-level global config",
1947
- "exclusive": [
1948
- "local"
1949
- ],
1950
- "name": "global",
1951
- "allowNo": false,
1952
- "type": "boolean"
1953
- },
1954
- "enable": {
1955
- "description": "Enable tracing (default)",
1956
- "exclusive": [
1957
- "disable"
1958
- ],
1959
- "name": "enable",
1960
- "allowNo": false,
1961
- "type": "boolean"
1962
- },
1963
- "disable": {
1964
- "description": "Disable tracing",
1965
- "exclusive": [
1966
- "enable"
1967
- ],
1968
- "name": "disable",
1969
- "allowNo": false,
1970
- "type": "boolean"
1971
- },
1972
- "project-id": {
1973
- "description": "Respan project ID (added to metadata / resource attributes)",
1974
- "env": "RESPAN_PROJECT_ID",
1975
- "name": "project-id",
1976
- "hasDynamicHelp": false,
1977
- "multiple": false,
1978
- "type": "option"
1979
- },
1980
- "base-url": {
1981
- "description": "Respan API base URL (for enterprise deployments)",
1982
- "name": "base-url",
1983
- "default": "https://api.respan.ai/api",
1893
+ "start-time": {
1894
+ "description": "Start time (ISO 8601)",
1895
+ "name": "start-time",
1896
+ "required": true,
1984
1897
  "hasDynamicHelp": false,
1985
1898
  "multiple": false,
1986
1899
  "type": "option"
1987
1900
  },
1988
- "attrs": {
1989
- "description": "Custom attributes JSON (e.g. '{\"env\":\"prod\"}')",
1990
- "name": "attrs",
1991
- "default": "{}",
1901
+ "end-time": {
1902
+ "description": "End time (ISO 8601)",
1903
+ "name": "end-time",
1904
+ "required": true,
1992
1905
  "hasDynamicHelp": false,
1993
1906
  "multiple": false,
1994
1907
  "type": "option"
1995
1908
  },
1996
- "customer-id": {
1997
- "description": "Customer/user identifier for traces (e.g. your name or email)",
1998
- "env": "RESPAN_CUSTOMER_ID",
1999
- "name": "customer-id",
1909
+ "filter": {
1910
+ "description": "Filter in field:operator:value format (repeatable)",
1911
+ "name": "filter",
2000
1912
  "hasDynamicHelp": false,
2001
- "multiple": false,
1913
+ "multiple": true,
2002
1914
  "type": "option"
2003
1915
  },
2004
- "span-name": {
2005
- "description": "Root span name for traces (default: claude-code)",
2006
- "name": "span-name",
1916
+ "all-envs": {
1917
+ "description": "Include all environments (true/false)",
1918
+ "name": "all-envs",
2007
1919
  "hasDynamicHelp": false,
2008
1920
  "multiple": false,
2009
1921
  "type": "option"
2010
1922
  },
2011
- "workflow-name": {
2012
- "description": "Workflow name for traces (default: claude-code)",
2013
- "name": "workflow-name",
1923
+ "is-test": {
1924
+ "description": "Filter by test (true) or production (false) environment",
1925
+ "name": "is-test",
2014
1926
  "hasDynamicHelp": false,
2015
1927
  "multiple": false,
2016
1928
  "type": "option"
2017
- },
2018
- "dry-run": {
2019
- "description": "Preview changes without writing files",
2020
- "name": "dry-run",
2021
- "allowNo": false,
2022
- "type": "boolean"
2023
1929
  }
2024
1930
  },
2025
1931
  "hasDynamicHelp": false,
2026
1932
  "hiddenAliases": [],
2027
- "id": "integrate:gemini-cli",
1933
+ "id": "logs:summary",
2028
1934
  "pluginAlias": "@respan/cli",
2029
1935
  "pluginName": "@respan/cli",
2030
1936
  "pluginType": "core",
@@ -2034,20 +1940,21 @@
2034
1940
  "relativePath": [
2035
1941
  "dist",
2036
1942
  "commands",
2037
- "integrate",
2038
- "gemini-cli.js"
1943
+ "logs",
1944
+ "summary.js"
2039
1945
  ]
2040
1946
  },
2041
- "integrate:opencode": {
1947
+ "integrate:claude-code": {
2042
1948
  "aliases": [],
2043
1949
  "args": {},
2044
- "description": "Integrate Respan with OpenCode.\n\nOpenCode's built-in OTel does not work reliably, so this uses the\ncommunity opencode-otel plugin instead.\n\nScope:\n --local Write plugin config to project root (default)\n --global Write to ~/.config/opencode/plugins/otel.json\n The opencode-otel package is always installed globally.",
1950
+ "description": "Integrate Respan with Claude Code.\n\nInstalls a Stop hook that reads conversation transcripts and sends\nthem to Respan as structured spans (chat, tool, thinking).\n\nScope:\n --global Install hook script + register in ~/.claude/settings.json\n --local Write credentials + enable flag to .claude/settings.local.json\n\nDefault behavior installs the global hook and writes local project config.",
2045
1951
  "examples": [
2046
- "respan integrate opencode",
2047
- "respan integrate opencode --disable",
2048
- "respan integrate opencode --global",
2049
- "respan integrate opencode --project-id my-project --attrs '{\"env\":\"prod\"}'",
2050
- "respan integrate opencode --dry-run"
1952
+ "respan integrate claude-code",
1953
+ "respan integrate claude-code --disable",
1954
+ "respan integrate claude-code --global",
1955
+ "respan integrate claude-code --local --project-id my-project",
1956
+ "respan integrate claude-code --attrs '{\"env\":\"prod\"}'",
1957
+ "respan integrate claude-code --dry-run"
2051
1958
  ],
2052
1959
  "flags": {
2053
1960
  "api-key": {
@@ -2175,7 +2082,7 @@
2175
2082
  },
2176
2083
  "hasDynamicHelp": false,
2177
2084
  "hiddenAliases": [],
2178
- "id": "integrate:opencode",
2085
+ "id": "integrate:claude-code",
2179
2086
  "pluginAlias": "@respan/cli",
2180
2087
  "pluginName": "@respan/cli",
2181
2088
  "pluginType": "core",
@@ -2186,13 +2093,21 @@
2186
2093
  "dist",
2187
2094
  "commands",
2188
2095
  "integrate",
2189
- "opencode.js"
2096
+ "claude-code.js"
2190
2097
  ]
2191
2098
  },
2192
- "logs:create": {
2099
+ "integrate:codex-cli": {
2193
2100
  "aliases": [],
2194
2101
  "args": {},
2195
- "description": "Create a log span",
2102
+ "description": "Integrate Respan with Codex CLI.\n\nInstalls a notify hook that reads session JSONL files and sends\nthem to Respan as structured spans (chat, tool, reasoning).\n\nScope:\n --global Install hook script + register notify in ~/.codex/config.toml\n --local Write .codex/respan.json with customer_id, span_name, etc.\n\nDefault behavior installs the global notify hook and writes local project config.",
2103
+ "examples": [
2104
+ "respan integrate codex-cli",
2105
+ "respan integrate codex-cli --disable",
2106
+ "respan integrate codex-cli --global",
2107
+ "respan integrate codex-cli --local --customer-id frank",
2108
+ "respan integrate codex-cli --attrs '{\"env\":\"prod\"}'",
2109
+ "respan integrate codex-cli --dry-run"
2110
+ ],
2196
2111
  "flags": {
2197
2112
  "api-key": {
2198
2113
  "description": "API key (env: RESPAN_API_KEY)",
@@ -2228,101 +2143,98 @@
2228
2143
  "allowNo": false,
2229
2144
  "type": "boolean"
2230
2145
  },
2231
- "input": {
2232
- "description": "Input text or JSON",
2233
- "name": "input",
2234
- "required": true,
2146
+ "local": {
2147
+ "description": "Write per-project config (default)",
2148
+ "exclusive": [
2149
+ "global"
2150
+ ],
2151
+ "name": "local",
2152
+ "allowNo": false,
2153
+ "type": "boolean"
2154
+ },
2155
+ "global": {
2156
+ "description": "Write user-level global config",
2157
+ "exclusive": [
2158
+ "local"
2159
+ ],
2160
+ "name": "global",
2161
+ "allowNo": false,
2162
+ "type": "boolean"
2163
+ },
2164
+ "enable": {
2165
+ "description": "Enable tracing (default)",
2166
+ "exclusive": [
2167
+ "disable"
2168
+ ],
2169
+ "name": "enable",
2170
+ "allowNo": false,
2171
+ "type": "boolean"
2172
+ },
2173
+ "disable": {
2174
+ "description": "Disable tracing",
2175
+ "exclusive": [
2176
+ "enable"
2177
+ ],
2178
+ "name": "disable",
2179
+ "allowNo": false,
2180
+ "type": "boolean"
2181
+ },
2182
+ "project-id": {
2183
+ "description": "Respan project ID (added to metadata / resource attributes)",
2184
+ "env": "RESPAN_PROJECT_ID",
2185
+ "name": "project-id",
2235
2186
  "hasDynamicHelp": false,
2236
2187
  "multiple": false,
2237
2188
  "type": "option"
2238
2189
  },
2239
- "output": {
2240
- "description": "Output text or JSON",
2241
- "name": "output",
2190
+ "base-url": {
2191
+ "description": "Respan API base URL (for enterprise deployments)",
2192
+ "name": "base-url",
2193
+ "default": "https://api.respan.ai/api",
2242
2194
  "hasDynamicHelp": false,
2243
2195
  "multiple": false,
2244
2196
  "type": "option"
2245
2197
  },
2246
- "model": {
2247
- "description": "Model name",
2248
- "name": "model",
2198
+ "attrs": {
2199
+ "description": "Custom attributes JSON (e.g. '{\"env\":\"prod\"}')",
2200
+ "name": "attrs",
2201
+ "default": "{}",
2249
2202
  "hasDynamicHelp": false,
2250
2203
  "multiple": false,
2251
2204
  "type": "option"
2252
2205
  },
2253
- "metadata": {
2254
- "description": "Metadata as JSON string",
2255
- "name": "metadata",
2206
+ "customer-id": {
2207
+ "description": "Customer/user identifier for traces (e.g. your name or email)",
2208
+ "env": "RESPAN_CUSTOMER_ID",
2209
+ "name": "customer-id",
2256
2210
  "hasDynamicHelp": false,
2257
2211
  "multiple": false,
2258
2212
  "type": "option"
2259
- }
2260
- },
2261
- "hasDynamicHelp": false,
2262
- "hiddenAliases": [],
2263
- "id": "logs:create",
2264
- "pluginAlias": "@respan/cli",
2265
- "pluginName": "@respan/cli",
2266
- "pluginType": "core",
2267
- "strict": true,
2268
- "enableJsonFlag": false,
2269
- "isESM": true,
2270
- "relativePath": [
2271
- "dist",
2272
- "commands",
2273
- "logs",
2274
- "create.js"
2275
- ]
2276
- },
2277
- "logs:get": {
2278
- "aliases": [],
2279
- "args": {
2280
- "id": {
2281
- "description": "Span ID",
2282
- "name": "id",
2283
- "required": true
2284
- }
2285
- },
2286
- "description": "Get a specific log span",
2287
- "flags": {
2288
- "api-key": {
2289
- "description": "API key (env: RESPAN_API_KEY)",
2290
- "env": "RESPAN_API_KEY",
2291
- "name": "api-key",
2213
+ },
2214
+ "span-name": {
2215
+ "description": "Root span name for traces (default: claude-code)",
2216
+ "name": "span-name",
2292
2217
  "hasDynamicHelp": false,
2293
2218
  "multiple": false,
2294
2219
  "type": "option"
2295
2220
  },
2296
- "profile": {
2297
- "description": "Named profile to use",
2298
- "name": "profile",
2221
+ "workflow-name": {
2222
+ "description": "Workflow name for traces (default: claude-code)",
2223
+ "name": "workflow-name",
2299
2224
  "hasDynamicHelp": false,
2300
2225
  "multiple": false,
2301
2226
  "type": "option"
2302
2227
  },
2303
- "json": {
2304
- "description": "Output as JSON",
2305
- "name": "json",
2306
- "allowNo": false,
2307
- "type": "boolean"
2308
- },
2309
- "csv": {
2310
- "description": "Output as CSV",
2311
- "name": "csv",
2312
- "allowNo": false,
2313
- "type": "boolean"
2314
- },
2315
- "verbose": {
2316
- "char": "v",
2317
- "description": "Show verbose output",
2318
- "name": "verbose",
2228
+ "dry-run": {
2229
+ "description": "Preview changes without writing files",
2230
+ "name": "dry-run",
2319
2231
  "allowNo": false,
2320
2232
  "type": "boolean"
2321
2233
  }
2322
2234
  },
2323
2235
  "hasDynamicHelp": false,
2324
2236
  "hiddenAliases": [],
2325
- "id": "logs:get",
2237
+ "id": "integrate:codex-cli",
2326
2238
  "pluginAlias": "@respan/cli",
2327
2239
  "pluginName": "@respan/cli",
2328
2240
  "pluginType": "core",
@@ -2332,14 +2244,21 @@
2332
2244
  "relativePath": [
2333
2245
  "dist",
2334
2246
  "commands",
2335
- "logs",
2336
- "get.js"
2247
+ "integrate",
2248
+ "codex-cli.js"
2337
2249
  ]
2338
2250
  },
2339
- "logs:list": {
2251
+ "integrate:gemini-cli": {
2340
2252
  "aliases": [],
2341
2253
  "args": {},
2342
- "description": "List and filter LLM request logs (spans).\n\nSupports pagination, sorting, time range, and server-side filtering.\n\nFILTER SYNTAX: field:operator:value\n\nOPERATORS:\n (empty) Exact match model::gpt-4\n not Not equal status_code:not:200\n gt Greater than cost:gt:0.01\n gte Greater than/equal latency:gte:1.0\n lt Less than cost:lt:0.5\n lte Less than/equal prompt_tokens:lte:100\n contains Contains substring error_message:contains:timeout\n icontains Case-insensitive model:icontains:gpt\n startswith Starts with model:startswith:gpt\n endswith Ends with model:endswith:mini\n in Value in list model:in:gpt-4,gpt-4o\n isnull Is null error_message:isnull:true\n iexact Case-insens. exact status:iexact:success\n\nFILTERABLE FIELDS (logs):\n model, status_code, status, cost, latency, prompt_tokens,\n completion_tokens, customer_identifier, custom_identifier,\n thread_identifier, trace_unique_id, span_name, span_workflow_name,\n environment, log_type, error_message, failed, provider_id,\n deployment_name, prompt_name, prompt_id, unique_id, stream,\n temperature, max_tokens, tokens_per_second, time_to_first_token,\n total_request_tokens, metadata__<key>, scores__<evaluator_id>\n\nEXAMPLES:\n --filter model::gpt-4o --filter cost:gt:0.01\n --filter status_code:not:200\n --filter metadata__env::production\n --filter model:in:gpt-4,gpt-4o",
2254
+ "description": "Integrate Respan with Gemini CLI.\n\nInstalls an AfterModel hook that captures LLM request/response data\nand sends it to Respan as structured spans with model, token counts,\nand input/output.\n\nScope:\n --global Write to ~/.gemini/settings.json (default)\n --local Write to .gemini/settings.json in project root\n\nGemini CLI ignores workspace-level telemetry settings, so --global is the default.",
2255
+ "examples": [
2256
+ "respan integrate gemini-cli",
2257
+ "respan integrate gemini-cli --disable",
2258
+ "respan integrate gemini-cli --local",
2259
+ "respan integrate gemini-cli --project-id my-project --attrs '{\"env\":\"prod\"}'",
2260
+ "respan integrate gemini-cli --dry-run"
2261
+ ],
2343
2262
  "flags": {
2344
2263
  "api-key": {
2345
2264
  "description": "API key (env: RESPAN_API_KEY)",
@@ -2375,75 +2294,98 @@
2375
2294
  "allowNo": false,
2376
2295
  "type": "boolean"
2377
2296
  },
2378
- "limit": {
2379
- "description": "Number of results per page (max 1000)",
2380
- "name": "limit",
2381
- "default": 50,
2382
- "hasDynamicHelp": false,
2383
- "multiple": false,
2384
- "type": "option"
2297
+ "local": {
2298
+ "description": "Write per-project config (default)",
2299
+ "exclusive": [
2300
+ "global"
2301
+ ],
2302
+ "name": "local",
2303
+ "allowNo": false,
2304
+ "type": "boolean"
2385
2305
  },
2386
- "page": {
2387
- "description": "Page number",
2388
- "name": "page",
2389
- "default": 1,
2390
- "hasDynamicHelp": false,
2391
- "multiple": false,
2392
- "type": "option"
2306
+ "global": {
2307
+ "description": "Write user-level global config",
2308
+ "exclusive": [
2309
+ "local"
2310
+ ],
2311
+ "name": "global",
2312
+ "allowNo": false,
2313
+ "type": "boolean"
2393
2314
  },
2394
- "sort-by": {
2395
- "description": "Sort field (prefix with - for descending, e.g. -cost, -latency)",
2396
- "name": "sort-by",
2397
- "hasDynamicHelp": false,
2398
- "multiple": false,
2399
- "type": "option"
2315
+ "enable": {
2316
+ "description": "Enable tracing (default)",
2317
+ "exclusive": [
2318
+ "disable"
2319
+ ],
2320
+ "name": "enable",
2321
+ "allowNo": false,
2322
+ "type": "boolean"
2400
2323
  },
2401
- "start-time": {
2402
- "description": "Start time filter (ISO 8601)",
2403
- "name": "start-time",
2324
+ "disable": {
2325
+ "description": "Disable tracing",
2326
+ "exclusive": [
2327
+ "enable"
2328
+ ],
2329
+ "name": "disable",
2330
+ "allowNo": false,
2331
+ "type": "boolean"
2332
+ },
2333
+ "project-id": {
2334
+ "description": "Respan project ID (added to metadata / resource attributes)",
2335
+ "env": "RESPAN_PROJECT_ID",
2336
+ "name": "project-id",
2404
2337
  "hasDynamicHelp": false,
2405
2338
  "multiple": false,
2406
2339
  "type": "option"
2407
2340
  },
2408
- "end-time": {
2409
- "description": "End time filter (ISO 8601)",
2410
- "name": "end-time",
2341
+ "base-url": {
2342
+ "description": "Respan API base URL (for enterprise deployments)",
2343
+ "name": "base-url",
2344
+ "default": "https://api.respan.ai/api",
2411
2345
  "hasDynamicHelp": false,
2412
2346
  "multiple": false,
2413
2347
  "type": "option"
2414
2348
  },
2415
- "filter": {
2416
- "description": "Filter in field:operator:value format (repeatable)",
2417
- "name": "filter",
2349
+ "attrs": {
2350
+ "description": "Custom attributes JSON (e.g. '{\"env\":\"prod\"}')",
2351
+ "name": "attrs",
2352
+ "default": "{}",
2418
2353
  "hasDynamicHelp": false,
2419
- "multiple": true,
2354
+ "multiple": false,
2420
2355
  "type": "option"
2421
2356
  },
2422
- "all-envs": {
2423
- "description": "Include all environments (true/false)",
2424
- "name": "all-envs",
2357
+ "customer-id": {
2358
+ "description": "Customer/user identifier for traces (e.g. your name or email)",
2359
+ "env": "RESPAN_CUSTOMER_ID",
2360
+ "name": "customer-id",
2425
2361
  "hasDynamicHelp": false,
2426
2362
  "multiple": false,
2427
2363
  "type": "option"
2428
2364
  },
2429
- "is-test": {
2430
- "description": "Filter by test (true) or production (false) environment",
2431
- "name": "is-test",
2365
+ "span-name": {
2366
+ "description": "Root span name for traces (default: claude-code)",
2367
+ "name": "span-name",
2432
2368
  "hasDynamicHelp": false,
2433
2369
  "multiple": false,
2434
2370
  "type": "option"
2435
2371
  },
2436
- "include-fields": {
2437
- "description": "Comma-separated fields to include in response",
2438
- "name": "include-fields",
2372
+ "workflow-name": {
2373
+ "description": "Workflow name for traces (default: claude-code)",
2374
+ "name": "workflow-name",
2439
2375
  "hasDynamicHelp": false,
2440
2376
  "multiple": false,
2441
2377
  "type": "option"
2378
+ },
2379
+ "dry-run": {
2380
+ "description": "Preview changes without writing files",
2381
+ "name": "dry-run",
2382
+ "allowNo": false,
2383
+ "type": "boolean"
2442
2384
  }
2443
2385
  },
2444
2386
  "hasDynamicHelp": false,
2445
2387
  "hiddenAliases": [],
2446
- "id": "logs:list",
2388
+ "id": "integrate:gemini-cli",
2447
2389
  "pluginAlias": "@respan/cli",
2448
2390
  "pluginName": "@respan/cli",
2449
2391
  "pluginType": "core",
@@ -2453,14 +2395,21 @@
2453
2395
  "relativePath": [
2454
2396
  "dist",
2455
2397
  "commands",
2456
- "logs",
2457
- "list.js"
2398
+ "integrate",
2399
+ "gemini-cli.js"
2458
2400
  ]
2459
2401
  },
2460
- "logs:summary": {
2402
+ "integrate:opencode": {
2461
2403
  "aliases": [],
2462
2404
  "args": {},
2463
- "description": "Get aggregated summary statistics for log spans in a time range.\n\nReturns total cost, total tokens, request count, and score summaries.\n\nFILTER SYNTAX: field:operator:value\n\nOPERATORS:\n (empty) Exact match model::gpt-4\n not Not equal status_code:not:200\n gt Greater than cost:gt:0.01\n gte Greater than/equal latency:gte:1.0\n lt Less than cost:lt:0.5\n lte Less than/equal prompt_tokens:lte:100\n contains Contains substring error_message:contains:timeout\n icontains Case-insensitive model:icontains:gpt\n startswith Starts with model:startswith:gpt\n endswith Ends with model:endswith:mini\n in Value in list model:in:gpt-4,gpt-4o\n isnull Is null error_message:isnull:true\n iexact Case-insens. exact status:iexact:success\n\nFILTERABLE FIELDS (logs):\n model, status_code, status, cost, latency, prompt_tokens,\n completion_tokens, customer_identifier, custom_identifier,\n thread_identifier, trace_unique_id, span_name, span_workflow_name,\n environment, log_type, error_message, failed, provider_id,\n deployment_name, prompt_name, prompt_id, unique_id, stream,\n temperature, max_tokens, tokens_per_second, time_to_first_token,\n total_request_tokens, metadata__<key>, scores__<evaluator_id>\n\nEXAMPLES:\n --filter model::gpt-4o --filter cost:gt:0.01\n --filter status_code:not:200\n --filter metadata__env::production\n --filter model:in:gpt-4,gpt-4o",
2405
+ "description": "Integrate Respan with OpenCode.\n\nOpenCode's built-in OTel does not work reliably, so this uses the\ncommunity opencode-otel plugin instead.\n\nScope:\n --local Write plugin config to project root (default)\n --global Write to ~/.config/opencode/plugins/otel.json\n The opencode-otel package is always installed globally.",
2406
+ "examples": [
2407
+ "respan integrate opencode",
2408
+ "respan integrate opencode --disable",
2409
+ "respan integrate opencode --global",
2410
+ "respan integrate opencode --project-id my-project --attrs '{\"env\":\"prod\"}'",
2411
+ "respan integrate opencode --dry-run"
2412
+ ],
2464
2413
  "flags": {
2465
2414
  "api-key": {
2466
2415
  "description": "API key (env: RESPAN_API_KEY)",
@@ -2496,47 +2445,98 @@
2496
2445
  "allowNo": false,
2497
2446
  "type": "boolean"
2498
2447
  },
2499
- "start-time": {
2500
- "description": "Start time (ISO 8601)",
2501
- "name": "start-time",
2502
- "required": true,
2448
+ "local": {
2449
+ "description": "Write per-project config (default)",
2450
+ "exclusive": [
2451
+ "global"
2452
+ ],
2453
+ "name": "local",
2454
+ "allowNo": false,
2455
+ "type": "boolean"
2456
+ },
2457
+ "global": {
2458
+ "description": "Write user-level global config",
2459
+ "exclusive": [
2460
+ "local"
2461
+ ],
2462
+ "name": "global",
2463
+ "allowNo": false,
2464
+ "type": "boolean"
2465
+ },
2466
+ "enable": {
2467
+ "description": "Enable tracing (default)",
2468
+ "exclusive": [
2469
+ "disable"
2470
+ ],
2471
+ "name": "enable",
2472
+ "allowNo": false,
2473
+ "type": "boolean"
2474
+ },
2475
+ "disable": {
2476
+ "description": "Disable tracing",
2477
+ "exclusive": [
2478
+ "enable"
2479
+ ],
2480
+ "name": "disable",
2481
+ "allowNo": false,
2482
+ "type": "boolean"
2483
+ },
2484
+ "project-id": {
2485
+ "description": "Respan project ID (added to metadata / resource attributes)",
2486
+ "env": "RESPAN_PROJECT_ID",
2487
+ "name": "project-id",
2503
2488
  "hasDynamicHelp": false,
2504
2489
  "multiple": false,
2505
2490
  "type": "option"
2506
2491
  },
2507
- "end-time": {
2508
- "description": "End time (ISO 8601)",
2509
- "name": "end-time",
2510
- "required": true,
2492
+ "base-url": {
2493
+ "description": "Respan API base URL (for enterprise deployments)",
2494
+ "name": "base-url",
2495
+ "default": "https://api.respan.ai/api",
2511
2496
  "hasDynamicHelp": false,
2512
2497
  "multiple": false,
2513
2498
  "type": "option"
2514
2499
  },
2515
- "filter": {
2516
- "description": "Filter in field:operator:value format (repeatable)",
2517
- "name": "filter",
2500
+ "attrs": {
2501
+ "description": "Custom attributes JSON (e.g. '{\"env\":\"prod\"}')",
2502
+ "name": "attrs",
2503
+ "default": "{}",
2518
2504
  "hasDynamicHelp": false,
2519
- "multiple": true,
2505
+ "multiple": false,
2520
2506
  "type": "option"
2521
2507
  },
2522
- "all-envs": {
2523
- "description": "Include all environments (true/false)",
2524
- "name": "all-envs",
2508
+ "customer-id": {
2509
+ "description": "Customer/user identifier for traces (e.g. your name or email)",
2510
+ "env": "RESPAN_CUSTOMER_ID",
2511
+ "name": "customer-id",
2525
2512
  "hasDynamicHelp": false,
2526
2513
  "multiple": false,
2527
2514
  "type": "option"
2528
2515
  },
2529
- "is-test": {
2530
- "description": "Filter by test (true) or production (false) environment",
2531
- "name": "is-test",
2516
+ "span-name": {
2517
+ "description": "Root span name for traces (default: claude-code)",
2518
+ "name": "span-name",
2519
+ "hasDynamicHelp": false,
2520
+ "multiple": false,
2521
+ "type": "option"
2522
+ },
2523
+ "workflow-name": {
2524
+ "description": "Workflow name for traces (default: claude-code)",
2525
+ "name": "workflow-name",
2532
2526
  "hasDynamicHelp": false,
2533
2527
  "multiple": false,
2534
2528
  "type": "option"
2529
+ },
2530
+ "dry-run": {
2531
+ "description": "Preview changes without writing files",
2532
+ "name": "dry-run",
2533
+ "allowNo": false,
2534
+ "type": "boolean"
2535
2535
  }
2536
2536
  },
2537
2537
  "hasDynamicHelp": false,
2538
2538
  "hiddenAliases": [],
2539
- "id": "logs:summary",
2539
+ "id": "integrate:opencode",
2540
2540
  "pluginAlias": "@respan/cli",
2541
2541
  "pluginName": "@respan/cli",
2542
2542
  "pluginType": "core",
@@ -2546,8 +2546,8 @@
2546
2546
  "relativePath": [
2547
2547
  "dist",
2548
2548
  "commands",
2549
- "logs",
2550
- "summary.js"
2549
+ "integrate",
2550
+ "opencode.js"
2551
2551
  ]
2552
2552
  },
2553
2553
  "prompts:create-version": {
@@ -3535,5 +3535,5 @@
3535
3535
  ]
3536
3536
  }
3537
3537
  },
3538
- "version": "0.7.2"
3538
+ "version": "0.7.3"
3539
3539
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@respan/cli",
3
- "version": "0.7.2",
3
+ "version": "0.7.3",
4
4
  "description": "Respan CLI - manage your LLM observability from the command line",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",