{"id":28280322,"url":"https://github.com/mocksi/hawksi","last_synced_at":"2025-06-16T21:33:00.398Z","repository":{"id":252721323,"uuid":"841249653","full_name":"Mocksi/Hawksi","owner":"Mocksi","description":"Hawksi: Rack middleware for Ruby apps to interact with Mocksi","archived":false,"fork":false,"pushed_at":"2024-10-01T02:18:33.000Z","size":64,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-06-09T10:13:14.803Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","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/Mocksi.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}},"created_at":"2024-08-12T02:56:27.000Z","updated_at":"2024-09-26T00:13:27.000Z","dependencies_parsed_at":"2024-08-28T05:54:59.256Z","dependency_job_id":null,"html_url":"https://github.com/Mocksi/Hawksi","commit_stats":null,"previous_names":["mocksi/hawks"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Mocksi/Hawksi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mocksi%2FHawksi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mocksi%2FHawksi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mocksi%2FHawksi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mocksi%2FHawksi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Mocksi","download_url":"https://codeload.github.com/Mocksi/Hawksi/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mocksi%2FHawksi/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260244945,"owners_count":22980105,"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","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-05-21T10:16:38.768Z","updated_at":"2025-06-16T21:33:00.385Z","avatar_url":"https://github.com/Mocksi.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hawksi\n\n## Overview\n\nHawksi sits between your application and the Mocksi API, allowing our agents to learn from your app to simulate whatever you can imagine.\n\n## Features\n\n### Request Interception\n\n\n#### Modules\n\n- **RequestInterceptor**\n  - **Description**: Middleware for intercepting and logging incoming HTTP requests and outgoing HTTP responses.\n  - **Actions**:\n    - `intercept_request`: Captures the request before forwarding it to the application.\n    - `intercept_response`: Captures the response before sending it back to the client.\n    - `log_request_response`: Stores logged data locally for future analysis.\n\n### Storage\n\nIntercepted calls are stored in a fast, thread-safe, filesystem-based storage system. Future integration with PostgreSQL is planned but not yet implemented.\n\n#### Modules\n\n- **FileStorage**\n  - **Description**: Stores requests and responses as JSON files in a structured directory format on the local filesystem.\n  - **Directory Structure**:\n    - Base Directory: `./mocksi/interceptor`\n    - Sub Directories:\n      - `requests/`\n      - `responses/`\n  - **Concurrency**:\n    - **ThreadedWriting**: Utilizes a background thread for file writing operations to maintain high performance and avoid blocking the main application flow.\n\n### CLI\n\nProvides a basic command-line interface for managing the HawksiInterceptor server and accessing stored requests.\n\n#### Commands\n\n- `start_server`: Starts the Hawksi Interceptor server.\n- `stop_server`: Stops the Hawksi Interceptor server.\n- `list_requests`: Lists recent intercepted requests.\n- `clear_data`: Clears stored request/response data.\n\n## Getting Started\n\nTo get started with Hawksi, ensure you have Ruby installed on your system. Then, install Hawksi by adding it to your Gemfile:\n\n```ruby\ngem 'hawksi'\n```\n\nRun `bundle install` to install Hawksi along with its dependencies. Once installed, you can start the HawksiInterceptor server using the CLI:\n\n```bash\nhawksi start\n```\n\nFor more detailed instructions and usage examples, refer to the [documentation](https://github.com/Mocksi/hawksi).\n\n## License\n\nHawksi is released under the MIT license. See the [LICENSE](LICENSE) file for details.\n\n## TODO\n\n- [x] Add upload command\n- [ ] Add standard for code formatting\n- [ ] Store logs in log/hawksi.log\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmocksi%2Fhawksi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmocksi%2Fhawksi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmocksi%2Fhawksi/lists"}