morph-labs / rift

Rift: an AI-native language server for your personal AI software engineer
https://morph.so
Apache License 2.0
3.04k stars 145 forks source link

Rift

Download for VSCode

Rift is open-source infrastructure for AI-native development environments. Rift makes your IDE agentic. Software will soon be written mostly by AI software engineers that work alongside you. Codebases will soon be living, spatial artifacts that maintain context, listen to, anticipate, react to, and execute your every intent. The Rift Code Engine implements an AI-native extension of the language server protocol. The Rift VSCode extension implements a client and end-user interface which is the first step into that future.

https://github.com/morph-labs/rift/assets/13114790/726f35ed-4959-4f69-9a80-fd903b26f909

Features

Conversational Code Editing

code edit screencast

Codebase-wide Edits

aider screencast

Contextual Codebase Generation

smol screencast

Auto Docstring Generation

auto doc screencast

Auto Type Annotation Generation

type inference screencast

Tips

Getting Started

Install the VSCode extension from the VSCode Marketplace. By default, the extension will attempt to automatically start the Rift Code Engine every time the extension is activated. During this process, if a rift executable is not found in a virtual environment under ~/.morph, the extension will ask you to attempt an automatic installation of a Python environment and the Rift Code Engine. To disable this behavior, such as for development, go to the VSCode settings, search for "rift", and set rift.autostart to false.

When rift.autostart is true, the extension will attempt to automatically start the Rift Code Engine. You can set rift.riftPath to change the path of the Rift executable, which may be necessary due to interactions with WSL on Windows.

When rift.autostart is false, the extension will display a loading indicator while it waits for a server instance to connect to rift.riftServerPort (default 7797). In this scenario, you will have to start the Rift server instance manually by running it in a terminal, e.g. with

source ~/.morph/env/bin/activate
rift --port 7797

Upon installation, when one changes the 'Code Edit Model' in the settings to our Rift Coder 7B model, it will automatically install an 8-bit quantized version of the model. The raw model can be found here.

If the automatic installation of the Rift Code Engine fails, follow the below instructions for manual installation.

Manual Installation

Rift Code Engine:

Rift VSCode Extension (via code --install-extension, change the executable as needed):

The Road Ahead

Existing code generation tooling is presently mostly code-agnostic, operating at the level of tokens in / tokens out of code LMs. The language server protocol (LSP) defines a standard for language servers, objects which index a codebase and provide structure- and runtime-aware interfaces to external development tools like IDEs.

The Rift Code Engine is an AI-native language server which will expose interfaces for code transformations and code understanding in a uniform, model- and language-agnostic way --- e.g. rift.summarize_callsites or rift.launch_ai_swe_async should work on a Python codebase with StarCoder as well as it works on a Rust codebase using CodeGen. Within the language server, models will have full programmatic access to language-specific tooling like compilers, unit and integration test frameworks, and static analyzers to produce correct code with minimal user intervention. We will develop UX idioms as needed to support this functionality in the Rift IDE extensions.

Contributing

We welcome contributions to Rift at all levels of the stack, for example:

See our contribution guide for details and guidelines.

Programming is evolving. Join the community, contribute to our roadmap, and help shape the future of software.

Feedback

We'd love to hear your feedback on Rift! Share your thoughts with us here.