{"id":31956337,"url":"https://github.com/profullstack/therapy","last_synced_at":"2025-10-23T20:21:09.853Z","repository":{"id":290862587,"uuid":"975807746","full_name":"profullstack/therapy","owner":"profullstack","description":null,"archived":false,"fork":false,"pushed_at":"2025-05-15T09:02:05.000Z","size":44,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-10-09T01:58:18.099Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/profullstack.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-04-30T23:54:23.000Z","updated_at":"2025-05-22T15:19:00.000Z","dependencies_parsed_at":"2025-05-01T01:18:56.484Z","dependency_job_id":"c7bff7bd-a75f-4496-baed-fb4f260082cb","html_url":"https://github.com/profullstack/therapy","commit_stats":null,"previous_names":["profullstack/therapy"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/profullstack/therapy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/profullstack%2Ftherapy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/profullstack%2Ftherapy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/profullstack%2Ftherapy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/profullstack%2Ftherapy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/profullstack","download_url":"https://codeload.github.com/profullstack/therapy/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/profullstack%2Ftherapy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280683818,"owners_count":26372970,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-23T02:00:06.710Z","response_time":142,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-10-14T14:48:34.115Z","updated_at":"2025-10-23T20:21:09.807Z","avatar_url":"https://github.com/profullstack.png","language":"JavaScript","readme":"# @profullstack/therapy\n\nA command-line interface for interactive AI therapy sessions in your terminal.\n\n[![GitHub](https://img.shields.io/github/license/profullstack/therapy)](https://github.com/profullstack/therapy/blob/master/LICENSE)\n[![GitHub commit activity](https://img.shields.io/github/commit-activity/m/profullstack/therapy)](https://github.com/profullstack/therapy/pulse)\n[![GitHub last commit](https://img.shields.io/github/last-commit/profullstack/therapy)](https://github.com/profullstack/therapy/commits/master)\n[![npm version](https://img.shields.io/npm/v/@profullstack/therapy)](https://www.npmjs.com/package/@profullstack/therapy)\n[![npm downloads](https://img.shields.io/npm/dm/@profullstack/therapy)](https://www.npmjs.com/package/@profullstack/therapy)\n\n## Features\n\n- 🧠 Multiple therapy modes (CBT, Person-centered, Trauma-informed)\n- 🤖 Support for different AI providers (OpenAI, Ollama)\n- 💬 Interactive terminal-based conversation\n- 🎨 Beautiful, colorful terminal output\n- 🔧 Configurable via command-line options or environment variables\n\n## Installation\n\n### Prerequisites\n\n- Node.js 18+ installed\n- For OpenAI: An OpenAI API key\n- For Ollama: [Ollama](https://ollama.ai/) installed and running locally\n\n### Install globally\n\n```bash\n# Install globally using pnpm\npnpm i -g @profullstack/therapy\n\n# Or using npm\nnpm i -g @profullstack/therapy\n```\n\n### Install from source\n\n```bash\n# Clone the repository\ngit clone https://github.com/profullstack/therapy.git\ncd therapy\n\n# Install dependencies\npnpm install\n\n# Link the CLI globally\npnpm link --global\n```\n\n## Configuration\n\nCreate a `.env` file in the project directory:\n\n```\nPROVIDER=openai\nOPENAI_API_KEY=your-openai-api-key\n```\n\nOr use command-line options to override these settings.\n\n## Usage\n\n```bash\n# Start a CBT therapy session with default provider\ntherapy\n\n# Start a trauma-informed therapy session\ntherapy --mode trauma\n\n# Start a person-centered therapy session with OpenAI\ntherapy -m person -p openai\n\n# Use a specific model\ntherapy --provider openai --model gpt-4-turbo\n\n# Show help\ntherapy --help\n```\n\n### Available Therapy Modes\n\n- `cbt` - Cognitive Behavioral Therapy (default)\n- `person` - Person-centered therapy\n- `trauma` - Trauma-informed care\n\n### Available Providers\n\n- `ollama` - Uses locally running Ollama (default)\n- `openai` - Uses OpenAI API (requires API key)\n\n### Exit Commands\n\nType any of these to end your therapy session:\n- `exit`\n- `quit`\n- `bye`\n\n## Event Handling in Node.js\n\nThis package includes examples of how to use event handling in Node.js modules. These examples demonstrate different patterns for implementing event-driven architecture in your applications.\n\n### Basic Event Handling\n\nThe `lib/event-examples.js` module provides several examples of event handling patterns:\n\n```javascript\nimport { createBasicEmitter } from '@profullstack/therapy';\n\n// Create a basic event emitter\nconst { emitter, stop } = createBasicEmitter();\n\n// Listen for events\nemitter.on('tick', (date) =\u003e {\n  console.log(`Tick at ${date}`);\n});\n\n// Stop the emitter after 5 seconds\nsetTimeout(stop, 5000);\n```\n\n### Class-based Event Emitters\n\nYou can extend the EventEmitter class to create custom event-emitting classes:\n\n```javascript\nimport { TherapyEventEmitter } from '@profullstack/therapy';\n\nconst therapySession = new TherapyEventEmitter();\n\n// Set up event listeners\ntherapySession.on('sessionStart', (data) =\u003e {\n  console.log(`Session started at ${data.time}`);\n});\n\ntherapySession.on('userInput', (data) =\u003e {\n  console.log(`Received user input: ${data.text}`);\n});\n\n// Start the session\ntherapySession.startSession();\n\n// Send user input\ntherapySession.receiveUserInput(\"I've been feeling stressed lately\");\n```\n\n### Factory Functions with Event Emitters\n\nFor more complex scenarios, you can use factory functions that return objects with event emitters:\n\n```javascript\nimport { createTherapyEventManager } from '@profullstack/therapy';\n\nconst therapyManager = createTherapyEventManager();\nconst { events, EVENT_TYPES } = therapyManager;\n\n// Set up event listeners using constants\nevents.on(EVENT_TYPES.SESSION_START, (data) =\u003e {\n  console.log(`New session started: ${data.sessionId}`);\n});\n\n// Start a session\ntherapyManager.startSession();\n\n// Process messages\ntherapyManager.processMessage(\"Hello, I need some help\");\n```\n\n### Event-Driven Therapy Sessions\n\nThe `examples/therapy-events.js` module demonstrates how to refactor the therapy application to use event-driven architecture:\n\n```javascript\nimport { EventDrivenTherapy } from '@profullstack/therapy';\n\n// Create a therapy session\nconst therapy = new EventDrivenTherapy({\n  mode: 'cbt',\n  provider: 'openai',\n  verbose: true\n});\n\n// Add custom event listeners\ntherapy.on('user:input', (data) =\u003e {\n  if (data.text.toLowerCase().includes('anxious')) {\n    console.log('User mentioned anxiety');\n  }\n});\n\n// Start the therapy session\ntherapy.start();\n```\n\n### Running the Examples\n\nTo run the included examples:\n\n```bash\n# Run the basic event demo\nnode examples/event-demo.js\n\n# Run the event-driven therapy example\nnode examples/therapy-events.js\n```\n\n## Disclaimer\n\nThis tool is not a replacement for professional mental health care. It uses AI to simulate therapeutic conversations but should not be used in place of licensed therapy, especially in crisis situations.\n\n## License\n\nMIT\n\n## Resources\n\n- [Therapy Transformer: Enhancing Mental Health Support with Large Language Models](https://arxiv.org/html/2504.12337v1)","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprofullstack%2Ftherapy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprofullstack%2Ftherapy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprofullstack%2Ftherapy/lists"}