feat: add --generate-intellij-config flag to app ssh command#1346
Merged
martin-helmich merged 11 commits intomasterfrom Sep 9, 2025
Merged
feat: add --generate-intellij-config flag to app ssh command#1346martin-helmich merged 11 commits intomasterfrom
martin-helmich merged 11 commits intomasterfrom
Conversation
- Add --generate-intellij-config flag to generate IntelliJ IDEA SSH and deployment configuration files - Generate .idea/sshConfigs.xml, .idea/webServers.xml, and .idea/deployment.xml files - Use proper XML parsing with fast-xml-parser library for robust XML handling - Support extending existing XML configuration files without overwriting - Prevent duplicate entries by checking existing configurations - Include comprehensive test suite with 15+ test cases covering XML generation, parsing, error handling, and edge cases - Extract app short ID from SSH connection data for configuration naming 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
… parsing - Extract common XML parser/builder configuration constants - Create reusable XML file manipulation utilities with type-safe configuration - Consolidate duplicate XML handling logic across SSH, web server, and deployment configs - Fix SSH username parsing to preserve complete user string (e.g., "[email protected]@app-id") - Remove redundant parseUserHost function that was incorrectly splitting usernames - Enhance tests to verify correct username handling in both SSH and web server configs - Reduce code from ~340 lines to ~270 lines while maintaining full functionality 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Reorder import statements alphabetically - Improve multiline formatting for better readability - Remove unused function parameter in addItemToArrayField - Simplify error handling logic in loadExistingXmlDocument - Apply consistent code style formatting 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Add comprehensive XML document type definitions for IntelliJ config files - Replace Record<string, unknown> with specific XmlDocument, XmlSshConfig, XmlWebServer, XmlPath interfaces - Create type-safe helper functions: addSshConfig, addWebServer, addDeploymentPath - Remove all 'as any' type assertions for full type safety - Update error handling test to expect thrown errors for malformed XML instead of silently recovering - Improve compile-time validation and IDE support with proper typing 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Create config_xml_types.ts with all XML interface definitions (9 interfaces, 80 lines) - Extract XmlDocument, XmlProject, XmlComponent and all related types from config.ts - Add proper imports for XML types in main config file - Improve code organization with separation of concerns between types and logic - Maintain full functionality while reducing main config file size by ~80 lines 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
When an SSH config already exists for a host, reuse its ID in web server configurations to maintain proper references between configuration files. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds a --generate-intellij-config flag to the app ssh command that automatically generates IntelliJ IDEA configuration files for SSH connections and file deployment. This eliminates the need for manual SSH/SFTP setup in IntelliJ when working with mittwald app installations.
Key Changes:
- Extended SSH connection data to include
appShortIdfor configuration naming - Added comprehensive IntelliJ XML configuration generation with smart merging capabilities
- Integrated new flag into the existing
app sshcommand with early return when used
Reviewed Changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/lib/resources/ssh/appinstall.ts | Extended return type to include appShortId for IntelliJ config naming |
| src/lib/intellij/config_xml_types.ts | Type definitions for IntelliJ XML configuration file structures |
| src/lib/intellij/config.ts | Core logic for generating and merging IntelliJ SSH, web server, and deployment configs |
| src/lib/intellij/config.test.ts | Comprehensive test suite covering XML generation, merging, and error handling |
| src/commands/app/ssh.ts | Integration of the new flag with early return when generating configs |
| package.json | Added fast-xml-parser dependency for XML manipulation |
| docs/app.md | Updated command documentation to include the new flag |
| CLAUDE.local.md | Local development note |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
…te checks Replace captured variables (data.host, data.appShortId) with function parameters (newItem properties) in XML duplicate checking logic to improve function reusability and prevent potential bugs from closure capture. Addresses Copilot feedback on PR #1346. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
--generate-intellij-configflag to theapp sshcommand to automatically generate IntelliJ IDEA SSH and deployment configuration files.Problem Solved
Currently, developers need to manually configure IntelliJ IDEA for SSH connectivity and file deployment to mittwald app installations. This involves:
[email protected]@app-idThis manual process is error-prone and time-consuming, especially when working with multiple app installations.
Solution
This PR introduces a
--generate-intellij-configflag that automatically creates the necessary IntelliJ configuration files:.idea/sshConfigs.xml- SSH connection settings with proper authentication.idea/webServers.xml- SFTP server configuration for file transfer.idea/deployment.xml- Directory mappings for seamless deploymentUsage
After running this command, developers can immediately use IntelliJ IDEA's SSH and deployment features without any manual configuration.
Benefits
🤖 Generated with Claude Code