Hide-py

Latest version: v0.5.2

Safety actively analyzes 681812 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

0.5.0

We're excited to announce the latest release of our project. This update brings several significant improvements and bug fixes.

✨ What's New

📂 Local Project Support
Hide now supports working with codebases directly from your filesystem. This is particularly useful for local development, private codebases, and huge repositories, allowing you to use Hide without requiring to pull a remote repository.

cURL

bash
curl --location 'http://localhost:8080/projects' \
--header 'Content-Type: application/json' \
--data '{
"repository": {
"url": "file:///Code/django"
},
"languages": [
"Python"
]
}'


Python

python
import hide
from hide import model

hc = hide.Client()

Create project with specific language support
project = hc.create_project(
repository=model.Repository(url="file:///Code/django"),
languages=[model.Language.PYTHON]
)


📑 Document Outline
The new document outline feature provides a structured view of your code, making it easier for agents to navigate through large files and understand code structure at a glance.

cURL

bash
curl --location 'http://localhost:8080/projects/{project_id}/outline/path/to/file.py'


Python

python
import hide
from hide import model

hc = hide.Client()

project = hc.create_project(
repository=model.Repository(url="file:///Code/django")
)

outline = hc.document_outline(
project_id=project.id,
file="path/to/file.py"
)


⏱️ Task Management
We've implemented client-side timeouts for running tasks to prevent indefinitely hanging operations and provide better control over long-running processes.

Thank you wistuba for proposing this feature 🙏

cURL

bash
curl --location 'http://localhost:8080/projects/{project_id}/tasks' \
--header 'X-Timeout-Seconds: 10' \
--data ' {
"command": "sleep 50"
}'


Python

python
import hide
from hide import model

hc = hide.Client()

project = hc.create_project(
repository=model.Repository(url="file:///Code/django")
)

result = hc.run_task(
project_id=project.id,
command="sleep 50",
timeout=10, time out and release resources after 10 second.
)


🛠️ Developer Experience
This release includes several improvements to make Hide more developer-friendly.
* Added OpenAPI [specification](https://github.com/hide-org/hide/blob/main/openapi.yaml) for better API documentation
* Introduced [Bruno](https://www.usebruno.com/) API collection for easier API testing
* Improved LSP server management with separate process groups and concurrent diagnostics handling
* Fixed issues with diagnostics on closed channels

🔮 What's Next?
We're actively working on expanding Hide's capabilities in several exciting directions:
* Adding support for Java and Scala development environments
* Exploring new options for hosting devcontainers
* Evaluating Hide's performance on swe-bench – if you're interested in driving this benchmarking effort, please reach out to us by hellohide.sh or join our discord channel https://discord.gg/8aemdtxNF8

👏 Changelog
* pkg/lsp: fixes issue where diagnostics are recieved on a closed channel by aleh-null in https://github.com/hide-org/hide/pull/136
* pkg/handlers: use equals for assertion by aleh-null in https://github.com/hide-org/hide/pull/133
* cmd: remove timeouts by artmoskvin in https://github.com/hide-org/hide/pull/137
* bruno: add hide collection by artmoskvin in https://github.com/hide-org/hide/pull/142
* pkg/lsp: concurent diagnostics handling by aleh-null in https://github.com/hide-org/hide/pull/140
* pkg/lsp: run in separate process group for graceful shutdown by aleh-null in https://github.com/hide-org/hide/pull/143
* pkg/project: support local projects by artmoskvin in https://github.com/hide-org/hide/pull/144
* pkg/handlers: use methods consts from http pkg by aleh-null in https://github.com/hide-org/hide/pull/145
* implement document outline by aleh-null in https://github.com/hide-org/hide/pull/146
* add openapi spec by artmoskvin in https://github.com/hide-org/hide/pull/152
* pkg/handlers: implement client side timeouts for running tasks by aleh-null in https://github.com/hide-org/hide/pull/155


**Full Changelog**: https://github.com/hide-org/hide/compare/v0.4.1...v0.5.0

0.4.1

We're excited to announce the latest release of our project. This update brings several improvements and bug fixes to enhance your development experience.

✨ What's New

📁 File Handling and Project Management
- Improved file listing with relative paths (thanks prabhuteja12 for reporting)
- Added support for `.gitignore` when listing files
- Implemented a tree-like formatter for listed files (details below)
- New `languages` parameter for project creation (details below)

🐳 Devcontainer and LSP Enhancements
- Added support for local images (thanks prabhuteja12 for reporting)
- Improved language detection using [go-enry](https://github.com/go-enry/go-enry)
- Implemented graceful shutdown of LSP servers

🚀 Performance and Bug Fixes
- Fixed an issue where LSP wasn't stopping when deleting a project (thanks wistuba for reporting)
- Fixed a bug related to missing `Close()` call in the gitignore reader (thanks wistuba for reporting)

We hope you enjoy this new release! As always, we welcome your feedback and contributions.

🔦 New `languages` parameter

We've introduced a new `languages` parameter to give you more control over LSP server initialization when creating a project. Here's what you need to know:

🧠 Background
When hide receives a request to create a new project, it attempts to detect the main programming language(s) to launch relevant LSP servers. While we've significantly improved the accuracy of language detection using [go-enry](https://github.com/go-enry/go-enry), we understand that sometimes you may want more explicit control.

⚙️ How It Works
The new `languages` parameter allows you to specify which LSP servers to start when creating a project. This ensures that you have the exact language support you need, regardless of automatic detection results.

🗣️ Supported Languages
The languages parameter currently supports the following values:
- Go
- JavaScript
- Python
- TypeScript

💡 Usage Examples

cURL

bash
curl --location 'http://localhost:8080/projects' \
--header 'Content-Type: application/json' \
--data '{
"repository": {
"url": "https://github.com/sphinx-doc/sphinx.git"
},
"devcontainer": {
"image": "mcr.microsoft.com/devcontainers/python:3.12",
"onCreateCommand": "pip install -e ."
},
"languages": [
"Python"
]
}'


Python

python
import hide
from hide import model

hc = hide.Client()

Create project with specific language support
project = hc.create_project(
repository=model.Repository(url="https://github.com/your-username/your-repo"),
languages=[model.Language.PYTHON]
)


📝 Note
If the `languages` parameter is not provided, hide will fall back to its automatic language detection using [go-enry](https://github.com/go-enry/go-enry).

🌳 Tree-like formatter

We've introduced a new tree-like format for listing files in your projects. This feature aims to provide a more intuitive and familiar representation of your project structure.

🧠 Background
JSON has been our foundation for representing file structures due to its flexibility and widespread use in data transport. It's an excellent base format that allows building various representations on top of it using SDK. However, we recognized the value in providing some common, ready-to-use formats directly from the API. This approach saves development time and offers immediate utility for many use cases, including AI agents that benefit from familiar, hierarchical representations.

⚙️ How It Works
The new tree-like formatter presents your project's file structure in a format similar to what you'd see when using the `tree` utility in a shell. This hierarchical representation makes it easier to visualize the structure of your project at a glance.

💡 Usage Example
To use the new tree-like format, you can specify in your API request. Here's an example using cURL:

bash
curl --location 'http://localhost:8080/projects/{project_id}/files' \
--header 'Accept: text/plain'


The response will look something like this:


.
├── src/
│ ├── main.py
│ └── utils/
│ ├── helper.py
│ └── config.py
├── tests/
│ ├── test_main.py
│ └── test_utils.py
├── README.md
└── requirements.txt


Here's an example in Python:

python
import hide
from hide import model

hc = hide.Client()

Create project with specific language support
project = hc.create_project(
repository=model.Repository(url="https://github.com/your-username/your-repo")
)

files = hc.list_files(
project_id=project.id,
format=model.ListFilesFormat.TREE
)


👏 Changelog
* pkg/files: use relative paths in listed files by artmoskvin in https://github.com/hide-org/hide/pull/113
* pkg/devcontainer: support local images by aleh-null in https://github.com/hide-org/hide/pull/119
* pkg/gitignore: read gitignore file and extract patterns by aleh-null in https://github.com/hide-org/hide/pull/117
* pkg/lsp: use go-enry for language detection by artmoskvin in https://github.com/hide-org/hide/pull/121
* pkg/files: wire in gitignore by aleh-null in https://github.com/hide-org/hide/pull/122
* rename hide org by artmoskvin in https://github.com/hide-org/hide/pull/124
* pkg/project: add languages parameter by artmoskvin in https://github.com/hide-org/hide/pull/125
* pkg/project: stop lsp when deleting project by artmoskvin in https://github.com/hide-org/hide/pull/128
* pkg/gitignore: bugfix missing Close() by aleh-null in https://github.com/hide-org/hide/pull/130
* pkg/frmtr: implement a tree like formater for path by aleh-null in https://github.com/hide-org/hide/pull/126
* pkg/lsp: shutdown lsp servers gracefully by artmoskvin in https://github.com/hide-org/hide/pull/131
* pkg/handlers: enable "text/plain" return from ListFiles by aleh-null in https://github.com/hide-org/hide/pull/132


**Full Changelog**: https://github.com/hide-org/hide/compare/v0.4.0...v0.4.1

0.4.0

Search API

Hide now provides search API to help agents navigate and explore projects efficiently. There are three main types of search available:
* Content Search
* File Search
* Symbol Search.

To start using search:
1. (if you use `brew`) Update Hide Runtime
1. uninstall hide `brew uninstall hide`
2. remove the old tap `brew untap artmoskvin/hide`
3. add the new tap `brew tap hide-org/formulae`
4. install hide `brew install hide`
2. (if you build from sources) pull the latest `git pull` and install `go install .`
3. Update Hide SDK for Python by running `pip install -U hide-py`.
4. Check out the documentation: https://hide.sh/usage/search/.
5. (Optionally) Join our new Discord community to chat about agents, tools, and dev environments https://discord.gg/8aemdtxNF8

Examples

cURL
bash
Exclude 'node_modules'
curl -X GET "http://localhost:8080/projects/{projectId}/search?type=content&query=your_search_query&exclude=**/node_modules"

Search for files containing the word "test" in their path
curl -X GET "http://localhost:8080/projects/{projectId}/files?include=test"

Search for symbol
curl -X GET "http://localhost:8080/projects/{projectId}/symbols?type=symbol&query=your_symbol_name"


python
python
import hide
from hide import model

hc = hide.Client()
project = hc.create_project(
repository=model.Repository(url="https://github.com/your-username/your-repo")
)

Exclude 'node_modules'
files = hc.search_files(
project_id=project.id,
query="your_query",
exclude=["/node_modules"]
)

Search for files containing the word "test" in their path
files = hc.list_files(
project_id=project.id,
include=["test"]
)

Search for symbol
symbols = hc.search_symbols(
project_id=project.id,
query="your_symbol_name"
)




What's Changed
* Refactor DockerClient and ImageManager from DevcontainerRunner by artmoskvin in https://github.com/hide-org/hide/pull/86
* Add container manager by artmoskvin in https://github.com/hide-org/hide/pull/92
* pkg/handlers: implement search by aleh-null in https://github.com/hide-org/hide/pull/91
* pkg/handlers: improve test coverage by artmoskvin in https://github.com/hide-org/hide/pull/94
* pkg/devcontainer: test runner by artmoskvin in https://github.com/hide-org/hide/pull/93
* Add symbol search by artmoskvin in https://github.com/hide-org/hide/pull/97
* pkg/handlers: nit showHidden flag by aleh-null in https://github.com/hide-org/hide/pull/98
* pkg/model: check if file contains new line before spliting by aleh-null in https://github.com/hide-org/hide/pull/103
* pkg/model: remove bufio from NewLines() by aleh-null in https://github.com/hide-org/hide/pull/106
* pkg/files: implement file name filtering using glob patterns for ListFile and SearchFiles endpoints by aleh-null in https://github.com/hide-org/hide/pull/99
* docs: add steps for installing lsp servers by artmoskvin in https://github.com/hide-org/hide/pull/104
* pkg/files: make read file optional in ListFiles by aleh-null in https://github.com/hide-org/hide/pull/107
* docs: update links and logo by artmoskvin in https://github.com/hide-org/hide/pull/108
* vendor: vendor dependencies by aleh-null in https://github.com/hide-org/hide/pull/109
* pkg/middleware: move middleware into a separate pkg by aleh-null in https://github.com/hide-org/hide/pull/111
* docs: search by artmoskvin in https://github.com/hide-org/hide/pull/110
* pkg/handlers: remove showHidden option from listFiles() by aleh-null in https://github.com/hide-org/hide/pull/112


**Full Changelog**: https://github.com/hide-org/hide/compare/v0.3.0...v0.4.0

Welcome to our Discord community

https://discord.gg/8aemdtxNF8

0.3.0

What's Changed
* Sets up zero log for structuring logging and nicer prompts (Issue 48) by aleh-null in https://github.com/artmoskvin/hide/pull/60
* Create model by artmoskvin in https://github.com/artmoskvin/hide/pull/61
* Refactoring/file manager by artmoskvin in https://github.com/artmoskvin/hide/pull/62
* Use file manager from project manager by artmoskvin in https://github.com/artmoskvin/hide/pull/63
* Create lsp service by artmoskvin in https://github.com/artmoskvin/hide/pull/64
* cmd/main: gracefull shutdown + gorilla/mux by aleh-null in https://github.com/artmoskvin/hide/pull/65
* Add middleware for path validation by artmoskvin in https://github.com/artmoskvin/hide/pull/68
* Use lines instead of content in File by artmoskvin in https://github.com/artmoskvin/hide/pull/70
* Change field names in TaskResult by artmoskvin in https://github.com/artmoskvin/hide/pull/72
* cmd/hide/main: use cobra to run hide by aleh-null in https://github.com/artmoskvin/hide/pull/71
* fix makefile to reflect updated file structure by aleh-null in https://github.com/artmoskvin/hide/pull/73
* Update documentation by artmoskvin in https://github.com/artmoskvin/hide/pull/74
* Create ClientPool and DiagnosticsStore by artmoskvin in https://github.com/artmoskvin/hide/pull/76
* Change Hide projects path by artmoskvin in https://github.com/artmoskvin/hide/pull/77
* pkg/config: hardcode next release version by aleh-null in https://github.com/artmoskvin/hide/pull/78

New Contributors
* aleh-null made their first contribution in https://github.com/artmoskvin/hide/pull/60

**Full Changelog**: https://github.com/artmoskvin/hide/compare/v0.2.0...v0.3.0

0.2.0

What's Changed
* Use mkdocs for docs by artmoskvin in https://github.com/artmoskvin/hide/pull/39
* Add tons of docs by artmoskvin in https://github.com/artmoskvin/hide/pull/40
* Add quickstart by artmoskvin in https://github.com/artmoskvin/hide/pull/44
* Show line numbers when reading files by artmoskvin in https://github.com/artmoskvin/hide/pull/49
* Update files with diffs by artmoskvin in https://github.com/artmoskvin/hide/pull/50


**Full Changelog**: https://github.com/artmoskvin/hide/compare/v0.1.0...v0.2.0

0.1.0

What's Changed
* Creates basic project structure by EvandroLG in https://github.com/artmoskvin/hide/pull/4
* Create go.yml by artmoskvin in https://github.com/artmoskvin/hide/pull/6
* Prototype dev container launcher by artmoskvin in https://github.com/artmoskvin/hide/pull/5
* Refactor project manager by artmoskvin in https://github.com/artmoskvin/hide/pull/7
* Add API for file manipulation by artmoskvin in https://github.com/artmoskvin/hide/pull/16
* Add API for submitting tasks by artmoskvin in https://github.com/artmoskvin/hide/pull/19
* Add DevContainer config parser by artmoskvin in https://github.com/artmoskvin/hide/pull/20
* Add Runner interface by artmoskvin in https://github.com/artmoskvin/hide/pull/21
* Improve container logging by artmoskvin in https://github.com/artmoskvin/hide/pull/26
* Update README.md by artmoskvin in https://github.com/artmoskvin/hide/pull/27
* Add devcontainer config in CreateProjectRequest by artmoskvin in https://github.com/artmoskvin/hide/pull/29
* Create project async by artmoskvin in https://github.com/artmoskvin/hide/pull/30
* Add delete project endpoint by artmoskvin in https://github.com/artmoskvin/hide/pull/31
* Use dotenv for configuration by artmoskvin in https://github.com/artmoskvin/hide/pull/35
* Create LICENSE by artmoskvin in https://github.com/artmoskvin/hide/pull/36
* Reorg main files by artmoskvin in https://github.com/artmoskvin/hide/pull/37
* Pass env file as command line arg by artmoskvin in https://github.com/artmoskvin/hide/pull/38

New Contributors
* EvandroLG made their first contribution in https://github.com/artmoskvin/hide/pull/4
* artmoskvin made their first contribution in https://github.com/artmoskvin/hide/pull/6

**Full Changelog**: https://github.com/artmoskvin/hide/commits/v0.1.0

Links

Releases

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.