feat: Embedded baseline MCP config and global tools
This commit is contained in:
Executable
+22
@@ -0,0 +1,22 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
# @describe Execute sql code.
|
||||
# @option --code! The code to execute.
|
||||
|
||||
# @meta require-tools usql
|
||||
|
||||
# @env USQL_DSN! The database connection url. e.g. pgsql://user:pass@host:port
|
||||
# @env LLM_OUTPUT=/dev/stdout The output path
|
||||
|
||||
PROMPT_UTILS="${LLM_ROOT_DIR:-$(dirname "${BASH_SOURCE[0]}")/..}/utils/prompt-utils.sh"
|
||||
# shellcheck disable=SC1090
|
||||
source "$PROMPT_UTILS"
|
||||
|
||||
# shellcheck disable=SC2154
|
||||
main() {
|
||||
if ! grep -qi '^select' <<<"$argc_code"; then
|
||||
guard_operation ""
|
||||
fi
|
||||
usql -c "$argc_code" "$USQL_DSN" >> "$LLM_OUTPUT"
|
||||
}
|
||||
Reference in New Issue
Block a user