GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - 2FastLabs/q-developer-wrapper: A lightweight SDK wrapper library for Amazon Q Developer CLI

BranchesTags
Open more actions menu

Latest commit

 

History

10 Commits
10 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
python
python
 
 
typescript
typescript
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 

Repository files navigation

Q Developer Wrapper

A lightweight SDK wrapper library for Amazon Q Developer CLI that enables seamless integration of AI capabilities into your applications, scripts, and automation workflows.

This library allows developers to programmatically interact with Amazon Q Developer, making it easy to build AI-powered features, automate code generation, create intelligent assistants, and enhance developer productivity tools - all while leveraging Amazon Q's advanced capabilities.

🔖 Features

  • 🔄 Simple API — Clean, promise-based interface for interacting with Amazon Q Developer CLI
  • 🌊 Streaming Output — Real-time streaming of responses as they're generated
  • 🔤 Dual language support — Fully implemented in TypeScript and Python
  • 🧩 Flexible Integration — Easy to integrate into any Node.js application or script
  • 🛠️ Interactive CLI — Ready-to-use interactive command-line interface included
  • 🌐 Cross-platform — Works on any platform where Amazon Q Developer CLI is available

Prerequisites

  1. Install Amazon Q Developer CLI from AWS Q Developer
  2. Authenticate: Run q login
  3. Verify: Run q chat --no-interactive "hello"

Installation

TypeScript/JavaScript

npm install q-developer-wrapper

For TypeScript development, also install:

npm install -D typescript @types/node ts-node

Python

pip install q-developer-wrapper

Basic Usage

import QDeveloperWrapper from 'q-developer-wrapper';

const q = new QDeveloperWrapper();

// Simple chat (no tools)
const answer = await q.chat('What are TypeScript best practices?');
console.log(answer);

// Execute with tools enabled (can create/modify files)
const code = await q.execute('Create a function to validate emails');
console.log(code);

// Full control
const response = await q.ask({
  message: 'Help me debug this code',
  acceptAllTools: true,
  timeout: 60000
});

if (response.success) {
  console.log(response.content);
} else {
  console.error(response.error);
}

Interactive Chat

For a complete interactive chat session, see the example file:

// Basic usage
const q = new QDeveloperWrapper();
const answer = await q.chat('What are TypeScript best practices?');
console.log(answer);

📁 Complete interactive chat examples:

  • TypeScript: typescript/examples/chat.ts
  • JavaScript: Coming soon

Quick start (TypeScript):

# Option 1: Install ts-node globally (one time)
npm install -g ts-node
ts-node typescript/examples/chat.ts

# Option 2: Use local installation
npm install -D typescript @types/node ts-node
npx ts-node typescript/examples/chat.ts

If you get "command not found: ts-node":

  • Install ts-node first: npm install -g ts-node

Features:

  • Interactive question/answer loop
  • /tools - Enable tools for next question
  • /notool - Disable tools
  • /exit - Exit session
  • Real-time streaming responses

API

Methods

ask(request: QRequest): Promise<QResponse>

  • request.message: Your prompt
  • request.acceptAllTools: Enable tool execution (default: false)
  • request.timeout: Timeout in ms (default: 120000)

chat(message: string): Promise<string>

  • Simple chat without tools, throws on error

execute(message: string): Promise<string>

  • Chat with tools enabled, throws on error

isAvailable(): Promise<boolean>

  • Check if Q CLI is available and authenticated

Types

interface QRequest {
  message: string;
  acceptAllTools?: boolean;
  timeout?: number;
}

interface QResponse {
  success: boolean;
  content: string;
  error?: string;
}

How It Works

Uses q chat --no-interactive with stdin input:

  • Sends messages via stdin (like echo "message" | q chat --no-interactive)
  • Tools run with --trust-all-tools flag when enabled
  • Real-time streaming output
  • Clean, programmatic interface

Perfect for automation, CI/CD, and interactive applications.

Language Implementations

  • TypeScript - Complete implementation
  • Python - Complete implementation

Authors

  • Corneliu Croitoru
  • Anthony Bernabeu

About

A lightweight SDK wrapper library for Amazon Q Developer CLI

Topics

amazonclidevqwrapper

Resources

Readme
MIT license
Activity
Custom properties

Stars

8 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.