Objective: This pilot study tested the preliminary efficacy of a theory-based bidirectional text messaging intervention (TEXT) on antiretroviral (ART) adherence, missed care visits, and substance use among people with HIV. Method: Participants with recent substance use and ART nonadherence from 2 nonurban HIV clinics were randomized to TEXT or to usual care (UC). The TEXT intervention included daily queries of ART adherence, mood, and substance use. The system sent contingent intervention messages created by participants for reports of adherence/nonadherence, good mood/poor mood, and no substance use/use. Assessments were at preintervention, postintervention, and 3-month postintervention follow-up. Objective primary outcomes were adherence, measured by past 3-month pharmacy refill rate, and proportion of missed visits (PMV), measured by medical records. The rate of substance-using days from the timeline follow-back was a secondary outcome. Results: Sixty-three patients participated, with 33 randomized to TEXT and 30 to UC. At preintervention, adherence was 64.0%, PMV was 26.9%, and proportion of days using substances was 53.0%. At postintervention, adherence in the TEXT condition improved from 66% to 85%, compared with 62% to 71% in UC participants (p = .04). PMV improved from 23% to 9% for TEXT participants and 31% to 28% in UC participants (p = .12). There were no significant differences between conditions in substance-using days at postintervention. At 3-month follow-up, differences were not significant. Conclusions: Personalized bidirectional text messaging improved adherence and shows promise to improve visit attendance, but did not reduce substance using days. This intervention merits further testing and may be cost-efficient given its automation.