-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.example.toml
More file actions
76 lines (67 loc) · 2.92 KB
/
Copy pathconfig.example.toml
File metadata and controls
76 lines (67 loc) · 2.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# Example configuration for the copilot-custom-logging plugin.
#
# Copy this file to one of the discovered locations and edit it:
# 1. the path in $COPILOT_OTEL_CONFIG, or
# 2. $COPILOT_HOME/copilot-otel-logging.toml, or
# 3. ~/.copilot/copilot-otel-logging.toml
#
# If no config file exists, the plugin does nothing.
[otel]
# Base OTLP/HTTP endpoint. The plugin POSTs logs to "{endpoint}/v1/logs" and,
# when session_trace is on, session spans to "{endpoint}/v1/traces".
endpoint = "https://collector.example.com:4318"
service_name = "github-copilot-cli"
# Timeout (seconds) applied to each command AND to the OTLP export.
timeout_sec = 5
# Emit one span per Copilot session (SessionStart..SessionEnd) and attach every
# log in the session to it. Default true.
session_trace = true
# session_span_name = "copilot.session"
[otel.headers]
# Header values support ${ENV} / $ENV expansion at runtime.
Authorization = "Bearer ${OTEL_TOKEN}"
# ---------------------------------------------------------------------------
# Hooks
#
# A hook is active simply by defining one or more commands for it. Each
# command runs in order. Its stdout is routed by `as`:
# as = "attribute" (default) -> attribute copilot.<name> (queryable facts)
# as = "body" -> entry in the body array (free-form/large)
# Omit a hook entirely to leave it off.
#
# Commands run via the shell and can read these environment variables set
# from the event payload:
# COPILOT_HOOK_EVENT - event name (e.g. UserPromptSubmit)
# COPILOT_HOOK_SESSION_ID - session id
# COPILOT_HOOK_CWD - working directory
# COPILOT_HOOK_TIMESTAMP - event timestamp
# COPILOT_HOOK_PROMPT - submitted prompt (UserPromptSubmit)
# COPILOT_HOOK_TOOL_NAME - tool name (PreToolUse / PostToolUse)
# COPILOT_HOOK_TOOL_RESULT - tool result text (PostToolUse)
# COPILOT_HOOK_PAYLOAD - full raw payload JSON (parse for anything else)
#
# Each command uses `run` on macOS/Linux (bash). Add an optional
# `run_powershell` for Windows; on Windows it is preferred over `run`.
# ---------------------------------------------------------------------------
[[hooks.UserPromptSubmit]]
name = "prompt"
run = "printf '%s' \"$COPILOT_HOOK_PROMPT\""
run_powershell = "Write-Output $env:COPILOT_HOOK_PROMPT"
as = "body" # free-form / high-cardinality -> keep out of attribute indexes
[[hooks.UserPromptSubmit]]
name = "github-user"
run = "gh api user -q .login"
[[hooks.UserPromptSubmit]]
name = "repo"
run = "git -C \"$COPILOT_HOOK_CWD\" remote get-url origin 2>/dev/null || true"
[[hooks.UserPromptSubmit]]
name = "branch"
run = "git -C \"$COPILOT_HOOK_CWD\" rev-parse --abbrev-ref HEAD 2>/dev/null || true"
run_powershell = "git -C \"$env:COPILOT_HOOK_CWD\" rev-parse --abbrev-ref HEAD 2>$null"
[[hooks.PreToolUse]]
name = "tool"
run = "printf '%s' \"$COPILOT_HOOK_TOOL_NAME\""
[[hooks.PostToolUse]]
name = "tool-result"
run = "printf '%s' \"$COPILOT_HOOK_TOOL_RESULT\""
as = "body"